p.`id`,p.`tenant_id`,p.`parent_tenant_id`,p.`merchant_id`,p.`last_pay_way`,p.`last_pay_type`,p.`last_pay_amount`,p.`remain_amount`,p.`total_amount` ,p.`remarks`,p.`operation_type`,p.`operator`,
p.`create_time`,p.`update_time`,m.`name` merchant_name
where 1 = 1
and p.`tenant_id` = #{tenantId}
and p.`parent_tenant_id` = #{parentTenantId}
and p.`id` = #{id}
and p.`merchant_id` = #{merchantId}
and p.`last_pay_type` = #{lastPayType}
and p.`last_pay_way` = #{lastPayWay}
and p.`operation_type` = #{operationType}
and m.`name` like concat('%',#{merchantName},'%')
and p.id in
#{idItem}
order by ${sortColumns}