|
|
@@ -10,7 +10,7 @@
|
|
|
insert into coupon_user(coupon_id,user_id)
|
|
|
values(#{couponId},#{userId})
|
|
|
</insert>
|
|
|
- <delete id="insertCouponUser">
|
|
|
+ <delete id="deleteCouponUser">
|
|
|
delete from coupon_user where coupon_id=#{couponId} and user_id =#{userId}
|
|
|
</delete>
|
|
|
|
|
|
@@ -19,7 +19,7 @@
|
|
|
</select>
|
|
|
|
|
|
<select id="selectCouponByUser" resultMap="Coupon">
|
|
|
- select * from coupon c left join coupon_user cu on c.id=cu.coupon_id where cu.user_id=#{userId}
|
|
|
+ select * from coupon c left join coupon_user cu on c.id=cu.coupon_id where cu.user_id=#{userId} and c.start_time < Now() and c.end_time > Now()
|
|
|
|
|
|
</select>
|
|
|
|