|
@ -34,7 +34,21 @@ |
|
|
<if test='startDate != null and endDate != null'>AND d.create_time BETWEEN #{startDate} AND #{endDate}</if> |
|
|
<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='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='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"> |
|
|
<if test="areas != null"> |
|
|
AND area IN |
|
|
AND area IN |
|
|
<foreach collection="areas" item="areas" open="(" separator="," close=")"> |
|
|
<foreach collection="areas" item="areas" open="(" separator="," close=")"> |
|
@ -84,8 +98,20 @@ |
|
|
<if test='refundType != null and refundType.length > 0'> |
|
|
<if test='refundType != null and refundType.length > 0'> |
|
|
AND d.refund_type LIKE CONCAT('%', #{refundType}, '%') |
|
|
AND d.refund_type LIKE CONCAT('%', #{refundType}, '%') |
|
|
</if> |
|
|
</if> |
|
|
<if test='refundGoods != null and refundGoods.length > 0'> |
|
|
|
|
|
AND d.refund_goods LIKE CONCAT('%', #{refundGoods}, '%') |
|
|
|
|
|
|
|
|
<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> |
|
|
<if test='startDate != null and endDate != null'> |
|
|
<if test='startDate != null and endDate != null'> |
|
|
AND d.create_time BETWEEN #{startDate} AND #{endDate} |
|
|
AND d.create_time BETWEEN #{startDate} AND #{endDate} |
|
@ -141,4 +167,11 @@ |
|
|
ORDER BY |
|
|
ORDER BY |
|
|
detaily_id DESC |
|
|
detaily_id DESC |
|
|
</select> |
|
|
</select> |
|
|
|
|
|
<!--检查是否有type值--> |
|
|
|
|
|
<select id="isIndexTypeExist" resultType="java.lang.Boolean"> |
|
|
|
|
|
SELECT EXISTS ( |
|
|
|
|
|
SELECT 1 FROM product |
|
|
|
|
|
WHERE type = 1 AND name = #{name} |
|
|
|
|
|
) |
|
|
|
|
|
</select> |
|
|
</mapper> |
|
|
</mapper> |