Commit c14bb974 by 崔彦峰

add:修改有效引荐数列表sql。

1 parent f8915ea2
...@@ -65,17 +65,9 @@ ...@@ -65,17 +65,9 @@
<select id="selectStoreList" resultMap="CommonDTOResultMap"> <select id="selectStoreList" resultMap="CommonDTOResultMap">
SELECT SELECT
serr.merchant_id, serr.merchant_id,
MIN(dclsm.merchant_name) AS merchant_name, dclsm.merchant_name,
serr.review_month, serr.review_month,
CASE IF(MIN(serr.status) &lt;= 1, 0, 1) AS submit_status
WHEN MAX(
CASE
WHEN serr.status IN (0, 1) THEN 1
ELSE 0
END
) = 1 THEN 0
ELSE 1
END AS submit_status
FROM FROM
sal_effective_referral_review serr sal_effective_referral_review serr
LEFT JOIN dj_car_life_service_merchant dclsm ON serr.merchant_id = dclsm.merchant_id LEFT JOIN dj_car_life_service_merchant dclsm ON serr.merchant_id = dclsm.merchant_id
...@@ -93,22 +85,17 @@ ...@@ -93,22 +85,17 @@
<if test="createdDate != null and createdDate != ''"> <if test="createdDate != null and createdDate != ''">
AND DATE_FORMAT(serr.created_date, '%Y-%m') = #{createdDate} AND DATE_FORMAT(serr.created_date, '%Y-%m') = #{createdDate}
</if> </if>
<if test="submitStatus != null">
HAVING
CASE
WHEN MAX(
CASE
WHEN serr.status IN (0, 1) THEN 1
ELSE 0
END
) = 1 THEN 0
ELSE 1
END = #{submitStatus}
</if>
GROUP BY GROUP BY
serr.merchant_id serr.merchant_id
<if test="submitStatus != null">
HAVING IF(MIN(serr.status) &lt;= 1, 0, 1) = #{submitStatus}
</if>
ORDER BY ORDER BY
CONVERT(MIN(dclsm.merchant_name) USING gbk) DESC CASE
WHEN merchant_name REGEXP '^[0-9]' THEN 1
ELSE 0
END,
CONVERT(UPPER(LEFT(merchant_name, 1)) USING gbk) ASC,
</select> </select>
<select id="selectStoreEffectiveReferralList" resultMap="CommonDTOResultMap"> <select id="selectStoreEffectiveReferralList" resultMap="CommonDTOResultMap">
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!