修改3-18问题
This commit is contained in:
@@ -22,4 +22,6 @@ public interface SmsCouponMapper extends BaseMapper<SmsCoupon> {
|
||||
List<SmsCoupon> selectRecive(@Param("memberId") Long memberId, @Param("limit") Integer limit);
|
||||
|
||||
SmsCouponParam getItem(@Param("id") Long id);
|
||||
|
||||
List<SmsCoupon> selectAll();
|
||||
}
|
||||
|
||||
@@ -54,6 +54,7 @@
|
||||
LEFT JOIN sms_coupon_product_category_relation cpcr ON cpcr.coupon_id = c.id
|
||||
WHERE ch.member_id = #{memberId}
|
||||
AND ch.use_status = 0 and now() >c.start_time and c.end_time>now()
|
||||
order by ch.amount desc
|
||||
</select>
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
|
||||
@@ -59,12 +59,18 @@
|
||||
|
||||
<select id="selectNotRecive" resultMap="BaseResultMap">
|
||||
SELECT sms_coupon.* from sms_coupon where count>0 and now()>=start_time and end_time>=now() and (SELECT count(*) from sms_coupon_history where member_id =
|
||||
#{memberId} and sms_coupon.id = coupon_id) < per_limit limit #{limit}
|
||||
#{memberId} and sms_coupon.id = coupon_id) < per_limit
|
||||
<if test="limit != null and limit != ''">
|
||||
limit #{limit}
|
||||
</if>
|
||||
|
||||
</select>
|
||||
<select id="selectRecive" resultMap="BaseResultMap">
|
||||
|
||||
SELECT sms_coupon.* from sms_coupon where id in (SELECT coupon_id from sms_coupon_history where member_id =
|
||||
#{memberId}) limit #{limit}
|
||||
</select>
|
||||
|
||||
<select id="selectAll" resultMap="BaseResultMap">
|
||||
SELECT sms_coupon.* from sms_coupon where count>0 and now()>=start_time and end_time>=now()
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
Reference in New Issue
Block a user