|
@@ -40,6 +40,7 @@
|
|
|
<result column="end_time" property="endTime"/>
|
|
|
<result column="opened_service_status" property="openedServiceStatus"/>
|
|
|
<result column="time" property="time"/>
|
|
|
+ <result column="service_ids" property="serviceIds"/>
|
|
|
</resultMap>
|
|
|
|
|
|
<!--根据用户id查询用户是否有开通产品-->
|
|
@@ -77,10 +78,20 @@
|
|
|
|
|
|
<!--根据用户查询已开通产品-->
|
|
|
<select id="opendedProductByUserId" resultMap="BaseResultWrapperMap" parameterType="java.lang.Long">
|
|
|
- select a.*,b.start_time,b.end_time,b.service_status as opened_service_status,c.time from diag_lantone_product a,diag_opened_products b,diag_product_order c,diag_order_details d
|
|
|
- where a.id=b.product_id and a.id=d.product_id and c.num=d.order_num
|
|
|
- and d.audit_status=1
|
|
|
- and a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and d.is_deleted='N'
|
|
|
- and b.user_id=#{userId} and c.user_id=#{userId} and d.user_id=#{userId}
|
|
|
+ select a.*,b.start_time,b.end_time,b.service_status as opened_service_status,c.time,t.service_ids
|
|
|
+ from diag_lantone_product a,diag_opened_products b,diag_product_order c,diag_order_details d,
|
|
|
+ (SELECT product_id,GROUP_CONCAT(service_id) as service_ids
|
|
|
+ FROM diag_product_service t1,diag_service_info t2
|
|
|
+ WHERE t1.service_id = t2.id
|
|
|
+ AND t1.is_deleted = 'N'
|
|
|
+ AND t2.is_deleted = 'N'
|
|
|
+ AND t2.user_id = #{userId}
|
|
|
+ AND t2.type = 1
|
|
|
+ GROUP BY t1.product_id) t
|
|
|
+ where a.id=b.product_id and a.id=d.product_id and a.id=t.product_id
|
|
|
+ and c.num=d.order_num
|
|
|
+ and d.audit_status=1
|
|
|
+ and a.is_deleted='N' and b.is_deleted='N' and c.is_deleted='N' and d.is_deleted='N'
|
|
|
+ and b.user_id=#{userId} and c.user_id=#{userId} and d.user_id=#{userId}
|
|
|
</select>
|
|
|
</mapper>
|