|
|
@ -34,7 +34,21 @@ |
|
|
|
<if test='startDate != null and endDate != null'>AND d.create_time BETWEEN #{startDate} AND #{endDate}</if> |
|
|
|
<if test='area!=null and area.length>0'>and user.area=#{area}</if> |
|
|
|
<if test='refundType != null and refundType.length>0'>AND d.refund_type LIKE CONCAT('%', #{refundType}, '%')</if> |
|
|
|
<if test='refundGoods != null and refundGoods.length>0'>AND d.refund_goods LIKE CONCAT('%', #{refundGoods}, '%')</if> |
|
|
|
<if test='refundGoods != null and refundGoods.length() > 0'> |
|
|
|
<choose> |
|
|
|
<!-- 是否走精确匹配 --> |
|
|
|
<when test="hasIndexMatch"> |
|
|
|
AND d.refund_goods IN ( |
|
|
|
SELECT name FROM `index` |
|
|
|
WHERE type = 1 AND remark = #{refundGoods} |
|
|
|
) |
|
|
|
</when> |
|
|
|
<!-- 否则模糊匹配 --> |
|
|
|
<otherwise> |
|
|
|
AND d.refund_goods LIKE CONCAT('%', #{refundGoods}, '%') |
|
|
|
</otherwise> |
|
|
|
</choose> |
|
|
|
</if> |
|
|
|
<if test="areas != null"> |
|
|
|
AND area IN |
|
|
|
<foreach collection="areas" item="areas" open="(" separator="," close=")"> |
|
|
|