优惠券 find接口
This commit is contained in:
@@ -41,15 +41,24 @@
|
||||
tb_activate_out_record outRecord
|
||||
INNER JOIN tb_activate_in_record inRecord
|
||||
on outRecord.give_id = inRecord.id
|
||||
and inRecord.shop_id = #{shopId}
|
||||
and inRecord.vip_user_id = #{vipUserId}
|
||||
<if test="shopId != null and shopId != ''">
|
||||
and inRecord.shop_id = #{shopId}
|
||||
</if>
|
||||
LEFT JOIN tb_product pro
|
||||
ON inRecord.pro_id = pro.id and pro.shop_id = #{shopId}
|
||||
ON inRecord.pro_id = pro.id
|
||||
<if test="shopId != null and shopId != ''">
|
||||
and pro.shop_id = #{shopId}
|
||||
</if>
|
||||
WHERE
|
||||
outRecord.vip_user_id = #{vipUserId}
|
||||
and outRecord.shop_id = #{shopId}
|
||||
and outRecord.status = 'closed'
|
||||
and outRecord.use_num-outRecord.ref_num >0
|
||||
outRecord.vip_user_id in
|
||||
<foreach item="item" index="index" collection="vipUserIds" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="shopId != null and shopId != ''">
|
||||
and outRecord.shop_id = #{shopId}
|
||||
</if>
|
||||
and outRecord.status = 'closed'
|
||||
and outRecord.use_num-outRecord.ref_num >0
|
||||
order by outRecord.create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user