|
|
@@ -17,28 +17,35 @@
|
|
|
</resultMap>
|
|
|
<select id="getMyStandards"
|
|
|
resultType="com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsVO">
|
|
|
- SELECT
|
|
|
- first_score/3,center_score/3,high_score/3
|
|
|
- FROM kxs_shd_score
|
|
|
- WHERE
|
|
|
- del_flag != 1
|
|
|
- and first_score >= 3
|
|
|
- and center_score >= 3
|
|
|
- and high_score >= 3
|
|
|
- and user_code = #{userCode}
|
|
|
- and month = #{month}
|
|
|
+ SELECT first_score / 3 as firstScore,
|
|
|
+ center_score / 3 as centerScore,
|
|
|
+ high_score / 3 as highScore
|
|
|
+ FROM kxs_shd_score
|
|
|
+ WHERE del_flag != 1
|
|
|
+ AND (
|
|
|
+ first_score >= 3
|
|
|
+ OR center_score >= 3
|
|
|
+ OR high_score >= 3
|
|
|
+ )
|
|
|
+ and user_code = #{userCode}
|
|
|
+ and month = #{month}
|
|
|
</select>
|
|
|
<select id="getMyStandardsAll"
|
|
|
resultType="com.kxs.user.api.vo.kxsapp.shareholder.ShareholderGetMyStandardsAllVO">
|
|
|
- SELECT sum(first_score/3) as firstScoreAll,
|
|
|
- sum(center_score/3) as centerScoreAll,
|
|
|
- sum(high_score/3) as highScoreAll
|
|
|
- FROM kxs_shd_score
|
|
|
- WHERE del_flag != 1
|
|
|
- and first_score >= 3
|
|
|
- and center_score >= 3
|
|
|
- and high_score >= 3
|
|
|
- and month = #{month}
|
|
|
+ SELECT
|
|
|
+ SUM(CASE WHEN first_score >= 3 THEN first_score / 3 ELSE 0 END) AS firstScoreAll,
|
|
|
+ SUM(CASE WHEN center_score >= 3 THEN center_score / 3 ELSE 0 END) AS centerScoreAll,
|
|
|
+ SUM(CASE WHEN high_score >= 3 THEN high_score / 3 ELSE 0 END) AS highScoreAll
|
|
|
+ FROM
|
|
|
+ kxs_shd_score
|
|
|
+ WHERE
|
|
|
+ del_flag != 1
|
|
|
+ AND (
|
|
|
+ first_score >= 3
|
|
|
+ OR center_score >= 3
|
|
|
+ OR high_score >= 3
|
|
|
+ )
|
|
|
+ AND month = #{month}
|
|
|
</select>
|
|
|
|
|
|
<select id="getShareholderHighScoreUserList"
|
|
|
@@ -58,9 +65,17 @@
|
|
|
id,username,user_code,id,user_id
|
|
|
FROM kxs_shd_score
|
|
|
WHERE del_flag != 1
|
|
|
- AND first_score >= 3
|
|
|
- AND center_score >= 3
|
|
|
- AND high_score >= 3
|
|
|
+ <choose>
|
|
|
+ <when test="type == 1">
|
|
|
+ AND first_score >= 3
|
|
|
+ </when>
|
|
|
+ <when test="type == 2">
|
|
|
+ AND center_score >= 3
|
|
|
+ </when>
|
|
|
+ <when test="type == 3">
|
|
|
+ AND high_score >= 3
|
|
|
+ </when>
|
|
|
+ </choose>
|
|
|
AND month = #{month}
|
|
|
<choose>
|
|
|
<when test="type == 1">
|