`id`,`tenant_id`,`parent_tenant_id`,`product_id`,`merchant_id`,`parameter`,`create_date`,`update_date`,`status`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `product_id` = #{productId}
and `merchant_id` = #{merchantId}
and `create_date` = #{createDate}
and `update_date` = #{updateDate}
and `status` = #{status}
and id in
#{idItem}
and merchant_id in
#{merchantIdItem}
and product_id in
#{productIdItem}
order by ${sortColumns}
update wx_coupon_merchant set `status` = #{status},`update_date`=now()
where tenant_id = #{tenantId}
and status != #{status}
and product_id = #{productId}
and merchant_id in
#{merchantIdItem}
insert into wx_coupon_merchant
(`id`,`product_id`,`merchant_id`,`parameter`,`create_date`,`update_date`,`status`)
values
(#{item.id,jdbcType=BIGINT},
#{item.productId,jdbcType=BIGINT},
#{item.merchantId,jdbcType=BIGINT},
#{item.parameter,jdbcType=VARCHAR},
#{item.createDate,jdbcType=TIMESTAMP},
#{item.updateDate,jdbcType=TIMESTAMP},
#{item.status,jdbcType=INTEGER})
delete from wx_coupon_merchant where `product_id` = #{productId} and `tenant_id` = #{tenantId}