|
@@ -45,5 +45,24 @@
|
|
|
where a.is_deleted='N' and b.is_deleted='N' and a.user_id=#{userId};
|
|
|
</select>
|
|
|
|
|
|
+ <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_sevice_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>
|
|
|
+
|
|
|
|
|
|
</mapper>
|