`id`,`tenant_id`,`card_id`,`owner_id`,`merchant_id`,`order_id`,`deduction_amount`,`payment`,`real_payment`,
`card_remain_amount`,`card_before_amount`,`card_remain_real_amount`,`card_before_real_amount`,
`create_date`,`update_date`, `pay_status`
where 1 = 1
and `id` = #{id}
and `tenant_id` = #{tenantId}
and `card_id` = #{cardId}
and `owner_id` = #{ownerId}
and `merchant_id` = #{merchantId}
and `order_id` = #{orderId}
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 `create_date` between #{startdate} and #{enddate}
and id in
#{idItem}
order by ${sortColumns}
cs.`id`,cs.`tenant_id`,cs.`card_id`,cs.`owner_id`,cs.`merchant_id`,cs.`order_id`,cs.`deduction_amount`,cs.`payment`,cs.`real_payment`,
cs.`card_remain_amount`,cs.`card_before_amount`,cs.`card_remain_real_amount`,cs.`card_before_real_amount`,
cs.`create_date`,cs.`update_date`, cs.`pay_status`,
m.`name`, c.`title`,
ms.`subsidy`,ms.`real_subsidy`,ms.`status`,
ou.`nick_name` as onick_name, ou.`phone` as ou_phone
where 1 = 1
and cs.`id` = #{id}
and cs.`tenant_id` = #{tenantId}
and cs.`card_id` = #{cardId}
and cs.`owner_id` = #{ownerId}
and cs.`merchant_id` = #{merchantId}
and cs.`order_id` = #{orderId}
and cs.`deduction_amount` = #{deductionAmount}
and cs.`payment` = #{payment}
and cs.`real_payment` = #{realPayment}
and cs.`card_remain_amount` = #{cardRemainAmount}
and cs.`card_before_amount` = #{cardBeforeAmount}
and cs.`card_remain_real_amount` = #{cardRemainRealAmount}
and cs.`card_before_real_amount` = #{cardBeforeRealAmount}
and cs.`create_date` = #{createDate}
and cs.`update_date` = #{updateDate}
and cs.`pay_status` = #{payStatus}
and ms.`status` = #{status}
and ou.`phone` = #{ouPhone}
and cs.`create_date` between #{startdate} and #{enddate}
and cs.`pay_status` in
#{sItem}
and cs.id in
#{idItem}