`id`,`tenant_id`,`parent_tenant_id`,`coupon_id`,`transaction_id`,
`amount`,`sale_amount`,`remaining_amount`,`service_fee_amount`,
`share_fee_amount`,`remaining_share_fee_amount`, `rate_amount`,
`create_date`,`update_date`,`support_transfer`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `coupon_id` = #{couponId}
and `transaction_id` = #{transactionId}
and `amount` = #{amount}
and `sale_amount` = #{saleAmount}
and `remaining_amount` = #{remainingAmount}
and `service_fee_amount` = #{serviceFeeAmount}
and `share_fee_amount` = #{shareFeeAmount}
and `remaining_share_fee_amount` = #{remainingShareFeeAmount}
and `rate_amount` = #{rateAmount}
and `create_date` = #{createDate}
and `update_date` = #{updateDate}
and `create_date` between #{startdate} and #{enddate}
and id in
#{idItem}
order by ${sortColumns}
ci.`id`,ci.`tenant_id`,ci.`parent_tenant_id`,ci.`coupon_id`,ci.`transaction_id`,
ci.`amount`,ci.`sale_amount`,ci.`remaining_amount`,ci.`service_fee_amount`,
ci.`share_fee_amount`,ci.`remaining_share_fee_amount`, ci.`rate_amount`,
ci.`create_date`,ci.`update_date`,
c.`cover_img`, c.`cover_picture`,c.`detail_picture`,c.`title`, c.`sub_title`, c.`detail`,
c.`unit`, c.`remark`, c.`sale_price`, c.`price`, c.`subsidy_type`, c.`subsidy_num`,
co.`c_user_id`, co.`owner_id`, co.`expired_time`, co.`coupon_order_status` as status,
ou.`nick_name` as c_nick_name, ou.`nick_name` as o_nick_name, ou.`phone` as ou_phone
where 1 = 1
and ci.`id` = #{id}
and ci.`tenant_id` = #{tenantId}
and ci.`parent_tenant_id` = #{parentTenantId}
and ci.`coupon_id` = #{couponId}
and ci.`transaction_id` = #{transactionId}
and ci.`amount` = #{amount}
and ci.`sale_amount` = #{saleAmount}
and ci.`remaining_amount` = #{remainingAmount}
and ci.`service_fee_amount` = #{serviceFeeAmount}
and ci.`share_fee_amount` = #{shareFeeAmount}
and ci.`remaining_share_fee_amount` = #{remainingShareFeeAmount}
and ci.`rate_amount` = #{rateAmount}
and ci.`create_date` = #{createDate}
and ci.`update_date` = #{updateDate}
and co.`coupon_order_status` = #{status}
and ou.`phone` = #{ouPhone}
and ci.`create_date` between #{startdate} and #{enddate}
and ou.`nick_name` like concat('%',#{onickName},'%')
and co.`coupon_order_status` in
#{sItem}
and ci.id in
#{idItem}
order by ci.id desc
update wx_card_info set support_transfer=0,update_date=now() where support_transfer=1 and coupon_id=#{couponId}