Просмотр исходного кода

商户注券->注券列表,有效期过滤

release_toaliyun_real
Burce 6 лет назад
Родитель
Сommit
2c089f37f0
1 измененных файлов: 15 добавлений и 12 удалений
  1. +15
    -12
      mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml

+ 15
- 12
mallinkService/src/main/resources/mapper/WxCouponSendMapper.xml Просмотреть файл

@@ -32,7 +32,7 @@
else else
'[多商户通用]' '[多商户通用]'
end) as merchant_name, end) as merchant_name,
c.remain_inventory, c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,cs.send_sms
c.remain_inventory, c.use_limit_quantity, c.inventory, c.valid_start_date, c.valid_end_date,c.valid_type,cs.send_sms
</sql> </sql>


<sql id="dynamicWhereConditions"> <sql id="dynamicWhereConditions">
@@ -109,17 +109,20 @@
<include refid="allColumns"/> <include refid="allColumns"/>
from wx_coupon_send cs left join wx_coupon c on c.id = cs.coupon_id from wx_coupon_send cs left join wx_coupon c on c.id = cs.coupon_id
<include refid="dynamicWhereConditions"/>) as tt <include refid="dynamicWhereConditions"/>) as tt
where 1=1
<choose>
<when test="expired == 0">
and <![CDATA[ tt.valid_end_date >= now() ]]>
</when>
<when test="expired == 1">
and <![CDATA[ tt.valid_end_date < now() ]]>
</when>
<otherwise>
</otherwise>
</choose>
where
(tt.valid_type=1
<choose>
<when test="expired == 0">
and <![CDATA[ tt.valid_end_date >= now() ]]>
</when>
<when test="expired == 1">
and <![CDATA[ tt.valid_end_date < now() ]]>
</when>
<otherwise>
</otherwise>
</choose>
)
or tt.valid_type=2
</select> </select>


<update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel"> <update id="updateStatusByCouponId" parameterType="com.iformall.domain.po.WxCouponChannel">


Загрузка…
Отмена
Сохранить