`id`,`tenant_id`,`parent_tenant_id`,`card_id`,`card_type`,`owner_id`,`pay_type`,`merchant_id`,`order_id`,`pos_order_id`,
`deduction_amount`,`payment`,`real_payment`,`subsidy`, `card_remain_amount`,
`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`,
`create_date`, `update_date`, `pay_status`, `pay_from`, `refund_status`, `refund_remark`, `settlement_status`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `parent_tenant_id` = #{parentTenantId}
and `card_id` = #{cardId}
and `owner_id` = #{ownerId}
and `pay_type` = #{payType}
and `merchant_id` = #{merchantId}
and `order_id` = #{orderId}
and `pos_order_id` = #{posOrderId}
and `deduction_amount` = #{deductionAmount}
and `payment` = #{payment}
and `real_payment` = #{realPayment}
and `card_remain_amount` = #{cardRemainAmount}
and `card_before_amount` = #{cardBeforeAmount}
and `card_remain_real_amount` = #{cardRemainRealAmount}
and `card_before_real_amount` = #{cardBeforeRealAmount}
and `create_date` = #{createDate}
and `update_date` = #{updateDate}
and `pay_status` = #{payStatus}
and `pay_from` = #{payFrom}
and `refund_status` = #{refundStatus}
and `settlement_status` = #{settlementStatus}
and `create_date` >= #{startdate}
and `create_date` <= #{enddate}
and `pay_type` in
#{ptItem}
and `merchant_id` in
#{midItem}
and `pay_status` in
#{psItem}
and `card_id` in
#{cardIdItem}
and owner_id in
#{owneridItem}
and order_id in
#{oidItem}
and id in
#{idItem}
order by ${sortColumns}
delete from wx_card_spend
where `tenant_id` = #{tenantId} and `id` = #{id} and `pay_status` = #{payStatus}