select count(*) from mt_user_coupon t where t.GROUP_ID = #{couponId}
SELECT t.COUPON_ID,count(t.ID) as num FROM mt_user_coupon t WHERE t.COUPON_ID = #{couponId} GROUP BY t.COUPON_ID
SELECT * FROM mt_user_coupon t WHERE t.USER_ID = #{userId} AND t.STATUS in
#{status}
ORDER BY t.BALANCE DESC
LIMIT 1000
SELECT * FROM mt_user_coupon t WHERE t.USER_ID = #{userId} AND t.COUPON_ID = #{couponId} AND t.STATUS in
#{status}
ORDER BY t.ID DESC
LIMIT 1000
SELECT * FROM mt_user_coupon t WHERE t.CODE = #{code}
ORDER BY t.ID DESC
update mt_user_coupon p set p.STATUS ='D',p.OPERATOR = #{operator} where p.UUID = #{uuid} and p.COUPON_ID in
#{couponId}
and p.status='A'
SELECT * FROM mt_user_coupon t WHERE t.GROUP_ID = #{groupId} AND (t.STATUS = 'A' OR t.STATUS = 'C')
ORDER BY t.ID DESC
SELECT t.COUPON_ID FROM mt_user_coupon t WHERE t.UUID = #{uuid} GROUP BY t.COUPON_ID
SELECT * FROM mt_user_coupon t WHERE t.COUPON_ID = #{couponId} AND t.USER_ID = #{userId} ORDER BY t.ID DESC
SELECT * FROM mt_user_coupon t WHERE t.STATUS = #{status}
and USER_ID = #{userId}
AND t.EXPIRE_TIME < #{endTime} AND t.EXPIRE_TIME > #{startTime}
ORDER BY t.ID ASC
update mt_user_coupon t set t.EXPIRE_TIME = #{expireTime} where t.COUPON_ID = #{couponId}