|
|
|
@@ -235,134 +235,140 @@ |
|
|
|
|
|
|
|
<sql id="dynamicWhereConditionsForCoupon"> |
|
|
|
where 1 = 1 |
|
|
|
<if test=" null != targetAd "> |
|
|
|
and 0 = (select count(*) from wx_coupon_channel cc |
|
|
|
where c.`id` = cc.coupon_id |
|
|
|
and cc.status = 0 |
|
|
|
and cc.target_ad = #{targetAd}) |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != id "> |
|
|
|
and `id` = #{id} |
|
|
|
and c.`id` = #{id} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != tenantId "> |
|
|
|
and `tenant_id` = #{tenantId} |
|
|
|
and c.`tenant_id` = #{tenantId} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null == type "> |
|
|
|
and `type` < 7 |
|
|
|
and c.`type` < 7 |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != type "> |
|
|
|
and `type` = #{type} |
|
|
|
and c.`type` = #{type} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != coverImg "> |
|
|
|
and `cover_img` like concat('%', #{coverImg},'%') |
|
|
|
and c.`cover_img` like concat('%', #{coverImg},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != title and ''!=title"> |
|
|
|
and `title` like concat('%', #{title},'%') |
|
|
|
and c.`title` like concat('%', #{title},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != subTitle "> |
|
|
|
and `sub_title` like concat('%', #{subTitle},'%') |
|
|
|
and c.`sub_title` like concat('%', #{subTitle},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != salePrice "> |
|
|
|
and `sale_price` = #{salePrice} |
|
|
|
and c.`sale_price` = #{salePrice} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != usePrice "> |
|
|
|
and `use_price` = #{usePrice} |
|
|
|
and c.`use_price` = #{usePrice} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != useLimitQuantity "> |
|
|
|
and `use_limit_quantity` = #{useLimitQuantity} |
|
|
|
and c.`use_limit_quantity` = #{useLimitQuantity} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != sendType "> |
|
|
|
and `send_type` = #{sendType} |
|
|
|
and c.`send_type` = #{sendType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validType "> |
|
|
|
and `valid_type` = #{validType} |
|
|
|
and c.`valid_type` = #{validType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validStartDate "> |
|
|
|
and `valid_start_date` = #{validStartDate} |
|
|
|
and c.`valid_start_date` = #{validStartDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validEndDate "> |
|
|
|
and `valid_end_date` = #{validEndDate} |
|
|
|
and c.`valid_end_date` = #{validEndDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != validDays "> |
|
|
|
and `valid_days` = #{validDays} |
|
|
|
and c.`valid_days` = #{validDays} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != detail "> |
|
|
|
and `detail` like concat('%', #{detail},'%') |
|
|
|
and c.`detail` like concat('%', #{detail},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != price "> |
|
|
|
and `price` = #{price} |
|
|
|
and c.`price` = #{price} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != unit "> |
|
|
|
and `unit` = #{unit} |
|
|
|
and c.`unit` = #{unit} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != remainInventory "> |
|
|
|
and `remain_inventory` = #{remainInventory} |
|
|
|
and c.`remain_inventory` = #{remainInventory} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != inventory "> |
|
|
|
and `inventory` = #{inventory} |
|
|
|
and c.`inventory` = #{inventory} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != remark "> |
|
|
|
and `remark` like concat('%', #{remark},'%') |
|
|
|
and c.`remark` like concat('%', #{remark},'%') |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != status"> |
|
|
|
and `status` = #{status} |
|
|
|
and c.`status` = #{status} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != startdate and null!=enddate"> |
|
|
|
and `create_date` between #{startdate} and #{enddate} |
|
|
|
and c.`create_date` between #{startdate} and #{enddate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != updateDate "> |
|
|
|
and `update_date` = #{updateDate} |
|
|
|
and c.`update_date` = #{updateDate} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != business "> |
|
|
|
and `business` = #{business} |
|
|
|
and c.`business` = #{business} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != supportTransfer "> |
|
|
|
and `support_transfer` = #{supportTransfer} |
|
|
|
and c.`support_transfer` = #{supportTransfer} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != subsidyType "> |
|
|
|
and `subsidy_type` = #{subsidyType} |
|
|
|
and c.`subsidy_type` = #{subsidyType} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != subsidyNum "> |
|
|
|
and `subsidy_num` = #{subsidyNum} |
|
|
|
and c.`subsidy_num` = #{subsidyNum} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != pressLimitNum "> |
|
|
|
and `press_limit_num` = #{pressLimitNum} |
|
|
|
and c.`press_limit_num` = #{pressLimitNum} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != pressLimitHours "> |
|
|
|
and `press_limit_hours` = #{pressLimitHours} |
|
|
|
and c.`press_limit_hours` = #{pressLimitHours} |
|
|
|
</if> |
|
|
|
|
|
|
|
<if test=" null != autoRefund "> |
|
|
|
and `auto_refund` = #{autoRefund} |
|
|
|
and c.`auto_refund` = #{autoRefund} |
|
|
|
</if> |
|
|
|
|
|
|
|
|
|
|
|
<if test=" null != ids "> |
|
|
|
and id in |
|
|
|
and c.id in |
|
|
|
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> |
|
|
|
#{idItem} |
|
|
|
</foreach> |
|
|
|
@@ -373,7 +379,7 @@ |
|
|
|
<select id="findCouponList" parameterType="com.iformall.domain.po.WxCoupon" resultMap="BaseResultMap"> |
|
|
|
select |
|
|
|
<include refid="allColumns"/> |
|
|
|
from wx_coupon |
|
|
|
from wx_coupon c |
|
|
|
<include refid="dynamicWhereConditionsForCoupon"/> |
|
|
|
</select> |
|
|
|
|
|
|
|
|