修改3-18问题

This commit is contained in:
2023-03-18 16:30:17 +08:00
parent 3ef558939b
commit b9ee4510db
5 changed files with 113 additions and 9 deletions

View File

@@ -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();
}

View File

@@ -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">

View File

@@ -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) &lt; per_limit limit #{limit}
#{memberId} and sms_coupon.id = coupon_id) &lt; 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>