|
@@ -83,24 +83,50 @@
|
|
</select>
|
|
</select>
|
|
|
|
|
|
<select id="getConsoleOnTrial" parameterType="long"
|
|
<select id="getConsoleOnTrial" parameterType="long"
|
|
- resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
|
|
|
|
- SELECT
|
|
|
|
- a.id as id,
|
|
|
|
- a.name as name,
|
|
|
|
- a.access_type as accessType,
|
|
|
|
- case when d.id is null then 'N' else 'Y' end as isUsed,
|
|
|
|
- a.trial_url as trialUrl,
|
|
|
|
- DATE_FORMAT(d.starting_date,'%Y-%m-%d') as startingDate,
|
|
|
|
- DATE_FORMAT(d.expiring_date,'%Y-%m-%d') as expiringDate
|
|
|
|
- FROM diag_lantone_product a LEFT JOIN diag_product_service b on a.id=b.product_id
|
|
|
|
- JOIN diag_service_info c on b.service_id=c.id
|
|
|
|
- JOIN diag_service_token d on b.id=d.product_service_id
|
|
|
|
- where a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and d.is_deleted='N'
|
|
|
|
- and a.trial_status=1
|
|
|
|
- and c.type=2
|
|
|
|
- and c.user_id=#{userId}
|
|
|
|
- and a.id not in (SELECT product_id FROM diag_opened_products where user_id=#{userId})
|
|
|
|
- </select>
|
|
|
|
|
|
+ resultType="com.diagbot.dto.GetConsoleOnTrialDTO">
|
|
|
|
+ SELECT
|
|
|
|
+ a.id as id,
|
|
|
|
+ a.name as name,
|
|
|
|
+ a.service_status as serviceStatus,
|
|
|
|
+ a.access_type as accessType,
|
|
|
|
+ a.trial_url as trialUrl,
|
|
|
|
+ b.app_key_id as appKeyId,
|
|
|
|
+ b.app_key_secret as appKeySecret,
|
|
|
|
+ b.`STATUS` as tokenStatus,
|
|
|
|
+ DATE_FORMAT(b.starting_date,'%Y-%m-%d') as expiringDate,
|
|
|
|
+ DATE_FORMAT(b.expiring_date,'%Y-%m-%d') as expiringDate
|
|
|
|
+ FROM
|
|
|
|
+ diag_lantone_product a
|
|
|
|
+ LEFT JOIN (
|
|
|
|
+ SELECT
|
|
|
|
+ b.product_id,
|
|
|
|
+ c.app_key_id,
|
|
|
|
+ c.app_key_secret,
|
|
|
|
+ c.`status`,
|
|
|
|
+ c.starting_date,
|
|
|
|
+ c.expiring_date
|
|
|
|
+ FROM
|
|
|
|
+ diag_service_info a
|
|
|
|
+ JOIN diag_product_service b ON a.id = b.service_id
|
|
|
|
+ JOIN diag_service_token c ON b.id = c.product_service_id
|
|
|
|
+ WHERE
|
|
|
|
+ a.is_deleted = 'N'
|
|
|
|
+ AND b.is_deleted = 'N'
|
|
|
|
+ AND c.is_deleted = 'N'
|
|
|
|
+ AND a.user_id = #{userId}
|
|
|
|
+ AND a.type = 2
|
|
|
|
+ AND c.type = 3
|
|
|
|
+ ) b ON a.id = b.product_id
|
|
|
|
+ WHERE
|
|
|
|
+ a.is_deleted = 'N' and a.trial_status=1
|
|
|
|
+ AND a.id NOT IN (
|
|
|
|
+ SELECT
|
|
|
|
+ product_id
|
|
|
|
+ FROM
|
|
|
|
+ diag_opened_products
|
|
|
|
+ WHERE
|
|
|
|
+ user_id = #{userId})
|
|
|
|
+ </select>
|
|
|
|
|
|
<select id="getConsoleOnTrialCount" parameterType="long" resultType="int">
|
|
<select id="getConsoleOnTrialCount" parameterType="long" resultType="int">
|
|
SELECT
|
|
SELECT
|