and a.`send_type` = #{sendType}
AND a.name LIKE concat('%',#{name},'%')
AND (a.store_id = #{storeId} OR a.is_all = 1)
AND (a.merch_sn = #{merchSn} OR a.is_all = 1)
AND s.third_party_merch_code = #{thirdPartyMerchCode}
insert into mall_coupon(
`name`,
`store_id`,
`merch_sn`,
`type_money`,
`send_type`,
`min_amount`,
`max_amount`,
`send_start_date`,
`send_end_date`,
`use_start_date`,
`use_end_date`,
`min_goods_amount`,
`is_all`)
values(
#{name},
#{storeId},
#{merchSn},
#{typeMoney},
#{sendType},
#{minAmount},
#{maxAmount},
#{sendStartDate},
#{sendEndDate},
#{useStartDate},
#{useEndDate},
#{minGoodsAmount},
#{isAll})
update mall_coupon
`name` = #{name},
`store_id` = #{storeId},
`merch_sn` = #{merchSn},
`type_money` = #{typeMoney},
`send_type` = #{sendType},
`min_amount` = #{minAmount},
`max_amount` = #{maxAmount},
`send_start_date` = #{sendStartDate},
`send_end_date` = #{sendEndDate},
`use_start_date` = #{useStartDate},
`use_end_date` = #{useEndDate},
`min_goods_amount` = #{minGoodsAmount},
`is_all` = #{isAll},
where id = #{id}
delete from mall_coupon where id = #{value}
delete from mall_coupon where id in
#{id}