|
@@ -290,8 +290,8 @@
|
|
|
|
|
|
|
|
<select id="selectUserCouponByGidAndPrice" resultType="com.cyksj.model.entity.Coupon">
|
|
<select id="selectUserCouponByGidAndPrice" resultType="com.cyksj.model.entity.Coupon">
|
|
|
select c.*,
|
|
select c.*,
|
|
|
- if(type = 'discount', ${sku.price} * (1 - c.discount), c.reduce_money) as couponMoney,
|
|
|
|
|
- from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time > now() and valid_end_time < now()) cu
|
|
|
|
|
|
|
+ if(type = 'discount', sku.price * (1 - c.discount), c.reduce_money) as couponMoney
|
|
|
|
|
+ from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time < now() and valid_end_time > now()) cu
|
|
|
inner join coupon c on c.id = cu.coupon_id
|
|
inner join coupon c on c.id = cu.coupon_id
|
|
|
inner join coupon_sku cs on cs.coupon_id = c.id and cs.goods_id = #{goodsId}
|
|
inner join coupon_sku cs on cs.coupon_id = c.id and cs.goods_id = #{goodsId}
|
|
|
inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true and sku.price = #{price}
|
|
inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true and sku.price = #{price}
|
|
@@ -300,8 +300,8 @@
|
|
|
|
|
|
|
|
<select id="selectUserCouponBySkuId" resultType="com.cyksj.model.entity.Coupon">
|
|
<select id="selectUserCouponBySkuId" resultType="com.cyksj.model.entity.Coupon">
|
|
|
select c.*,
|
|
select c.*,
|
|
|
- if(type = 'discount', ${sku.price} * (1 - c.discount), c.reduce_money) as couponMoney,
|
|
|
|
|
- from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time > now() and valid_end_time < now()) cu
|
|
|
|
|
|
|
+ if(type = 'discount', sku.price * (1 - c.discount), c.reduce_money) as couponMoney
|
|
|
|
|
+ from (select coupon_id from coupon_user where user_id = #{userId} and status = 'unused' and valid_start_time < now() and valid_end_time > now()) cu
|
|
|
inner join coupon c on c.id = cu.coupon_id
|
|
inner join coupon c on c.id = cu.coupon_id
|
|
|
inner join coupon_sku cs on cs.coupon_id = c.id and cs.sku_id = #{skuId}
|
|
inner join coupon_sku cs on cs.coupon_id = c.id and cs.sku_id = #{skuId}
|
|
|
inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true
|
|
inner join goods_don_sku sku on sku.id = cs.sku_id and sku.status is true
|