|
|
|
@@ -233,6 +233,9 @@ |
|
|
|
and `credit_refund` = #{creditRefund} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" 1 == filterCanPut "> |
|
|
|
and `credit_refund` = #{creditRefund} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
@@ -248,7 +251,6 @@ |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
@@ -256,7 +258,7 @@ |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_coupon |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
<include refid="dynamicWhereConditions"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
<update id="updateStockAndValidDate" parameterType="com.iformall.domain.po.WxCoupon"> |
|
|
|
@@ -405,6 +407,22 @@ |
|
|
|
and c.`auto_refund` = #{autoRefund} |
|
|
|
</if> |
|
|
|
|
|
|
|
<!--如果配置了审批模板,需要过滤投放审批状态--> |
|
|
|
<if test="0 != filterCanPut or null ==filterCanPut "> |
|
|
|
<if test=" null != pressModelId "> |
|
|
|
and if(type=8,put_apply_status =2,1=1) |
|
|
|
</if> |
|
|
|
<if test=" null != groupModelId "> |
|
|
|
and if(type=9,put_apply_status =2,1=1) |
|
|
|
</if> |
|
|
|
<if test=" null != cardModelId "> |
|
|
|
and if(type=100,put_apply_status =2,1=1) |
|
|
|
</if> |
|
|
|
<if test=" null != couponModelId "> |
|
|
|
|
|
|
|
and if(type !=8 and type !=9 and type!=100,put_apply_status =2,1=1) |
|
|
|
</if> |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and c.id in |
|
|
|
@@ -420,12 +438,6 @@ |
|
|
|
</foreach> |
|
|
|
</if> |
|
|
|
|
|
|
|
<!-- |
|
|
|
<if test="0 == status "> |
|
|
|
and c.id not in |
|
|
|
(select coupon_id from wx_coupon_channel where tenant_id=#{tenantId} and status = 0) |
|
|
|
</if>--> |
|
|
|
|
|
|
|
<if test=" null != sortColumns">order by ${sortColumns}</if> |
|
|
|
</sql> |
|
|
|
|
|
|
|
@@ -434,8 +446,18 @@ |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_coupon c |
|
|
|
<include refid="dynamicWhereConditionsForCoupon"/> |
|
|
|
limit #{limitStart},#{limitEnd} |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCouponListCount" parameterType="com.iformall.domain.po.WxCoupon" resultType="Integer"> |
|
|
|
select |
|
|
|
count(*) |
|
|
|
from wx_coupon c |
|
|
|
<include refid="dynamicWhereConditionsForCoupon"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<resultMap id="WxCouponCVoMap" type="com.iformall.domain.vo.WxCouponCVo"> |
|
|
|
<id column="id" jdbcType="BIGINT" property="id"/> |
|
|
|
@@ -831,4 +853,12 @@ where cpd.tenant_id=#{tenantId} |
|
|
|
and ct.status = 0 |
|
|
|
</select> |
|
|
|
|
|
|
|
<select id="findCouponModel" parameterType="com.iformall.domain.po.WxCoupon" resultType="com.iformall.domain.po.WxCoupon"> |
|
|
|
select |
|
|
|
max(case type when 9 then model_id else 0 end) couponModelId, |
|
|
|
max(case type when 10 then model_id else 0 end) cardModelId, |
|
|
|
max(case type when 11 then model_id else 0 end) groupModelId, |
|
|
|
max(case type when 12 then model_id else 0 end) pressModelId |
|
|
|
from wx_flow_config where type in(9,10,11,12) and tenant_id=#{tenantId} |
|
|
|
</select> |
|
|
|
</mapper> |