Browse Source

04-09 资金流水,状态筛选优化

lijianlin/feature-20260401-现金管理四期
lijianlin 3 hours ago
parent
commit
f3e78c7059
  1. 48
      src/main/resources/cashMapper/CashRefundMapper.xml

48
src/main/resources/cashMapper/CashRefundMapper.xml

@ -513,12 +513,22 @@
#{statuses} #{statuses}
</foreach> </foreach>
</if> </if>
<if test="areaPayTypeList != null and areaPayTypeList.size > 0">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
(crc.received_market = #{item.areaId,jdbcType=INTEGER} AND crc.pay_type = #{item.payType,jdbcType=VARCHAR})
<if test="areaPayTypeList != null and areaPayTypeList.size() > 0">
<bind name="hasValidCondition" value="false" />
<foreach collection="areaPayTypeList" item="item">
<if test="item.areaId != null and item.areaId != '' and item.payType != null and item.payType != ''">
<bind name="hasValidCondition" value="true" />
</if>
</foreach> </foreach>
)
<if test="hasValidCondition">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
<if test="item.areaId != null and item.areaId != '' and item.payType != null and item.payType != ''">
(crc.received_market = #{item.areaId,jdbcType=INTEGER} AND crc.pay_type = #{item.payType,jdbcType=VARCHAR})
</if>
</foreach>
)
</if>
</if> </if>
UNION ALL UNION ALL
@ -554,7 +564,7 @@
FROM cash_record_refund crr FROM cash_record_refund crr
INNER JOIN cash_record_collection crc ON crr.related_id = crc.id INNER JOIN cash_record_collection crc ON crr.related_id = crc.id
left join recharge_activity ra on ra.id = crc.activity left join recharge_activity ra on ra.id = crc.activity
WHERE crc.status =6 and crr.status =41
WHERE crr.status =41
<if test="jwcode != null"> <if test="jwcode != null">
and crc.jwcode = #{jwcode} and crc.jwcode = #{jwcode}
</if> </if>
@ -564,6 +574,12 @@
#{markets} #{markets}
</foreach> </foreach>
</if> </if>
<if test="statuses!=null and statuses.size()>0">
and crc.status IN
<foreach collection="statuses" item="statuses" open="(" separator="," close=")">
#{statuses}
</foreach>
</if>
<if test="performanceMarkets!= null and performanceMarkets.size > 0"> <if test="performanceMarkets!= null and performanceMarkets.size > 0">
AND crc.performance_market IN AND crc.performance_market IN
<foreach collection="performanceMarkets" item="performanceMarkets" open="(" separator="," close=")"> <foreach collection="performanceMarkets" item="performanceMarkets" open="(" separator="," close=")">
@ -582,12 +598,22 @@
<if test="orderCode!= null and orderCode.length > 0"> <if test="orderCode!= null and orderCode.length > 0">
AND crc.order_code like CONCAT('%', #{orderCode}, '%') AND crc.order_code like CONCAT('%', #{orderCode}, '%')
</if> </if>
<if test="areaPayTypeList != null and areaPayTypeList.size > 0">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
(crc.received_market = #{item.areaId,jdbcType=INTEGER} AND crc.pay_type = #{item.payType,jdbcType=VARCHAR})
<if test="areaPayTypeList != null and areaPayTypeList.size() > 0">
<bind name="hasValidCondition" value="false" />
<foreach collection="areaPayTypeList" item="item">
<if test="item.areaId != null and item.areaId != '' and item.payType != null and item.payType != ''">
<bind name="hasValidCondition" value="true" />
</if>
</foreach> </foreach>
)
<if test="hasValidCondition">
AND (
<foreach collection="areaPayTypeList" item="item" separator=" OR ">
<if test="item.areaId != null and item.areaId != '' and item.payType != null and item.payType != ''">
(crc.received_market = #{item.areaId,jdbcType=INTEGER} AND crc.pay_type = #{item.payType,jdbcType=VARCHAR})
</if>
</foreach>
)
</if>
</if> </if>
) AS combined_result ) AS combined_result
ORDER BY ORDER BY

Loading…
Cancel
Save