Browse Source

20201127v2.0

tiaosheng
zy_Java 5 years ago
parent
commit
db74d2a616
  1. 2
      mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java
  2. 6
      mt/src/main/java/com/ccsens/mt/service/CompeteService.java
  3. 4
      mt/src/main/resources/application.yml
  4. 99
      mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

2
mt/src/main/java/com/ccsens/mt/persist/dao/CompeteScoreDao.java

@ -144,5 +144,5 @@ public interface CompeteScoreDao {
* @param competeGroupId
* @return
*/
List<ScoreVo.CompeteScore> selectVatietyPlayer(Long projectId, Long competeGroupId);
List<ScoreVo.CompeteScore> selectVarietyPlayer(@Param("projectId")Long projectId, @Param("competeGroupId")Long competeGroupId);
}

6
mt/src/main/java/com/ccsens/mt/service/CompeteService.java

@ -1400,16 +1400,14 @@ public class CompeteService implements ICompeteService {
if (competeProject.getTeam() == Constant.Compete.TEAM_YES) {
// 团体赛
competeScoreList = competeScoreDao.selectCountTeam(params.getProjectId(), params.getCompeteGroupId());
// competeScoreDao.queryCountScoreTeam(param.getProjectId());
} else {
// 个人赛
competeScoreList = competeScoreDao.selectCountPlayer(params.getProjectId(), params.getCompeteGroupId());
// competeScoreDao.queryCountScorePerson(param.getProjectId());
// }
}
}else {
//花样赛
competeScoreList = competeScoreDao.selectVatietyPlayer(params.getProjectId(), params.getCompeteGroupId());
competeScoreList = competeScoreDao.selectVarietyPlayer(params.getProjectId(), params.getCompeteGroupId());
}
// //如果比赛是个人计数赛
// if (fatherId == 2001 && team == 0){

4
mt/src/main/resources/application.yml

@ -1,6 +1,6 @@
spring:
profiles:
active: prod
include: common, util-prod
active: test
include: common, util-test

99
mt/src/main/resources/mapper_dao/CompeteScoreDao.xml

@ -1106,6 +1106,7 @@
</select>
<select id="selectCountTeam" resultType="com.ccsens.mt.bean.vo.ScoreVo$CompeteScore">
SELECT
t1.*,
count( t2.id ) + 1 AS rangee
@ -1121,7 +1122,7 @@
score.should_times AS shouldScore,
score.deduct_times AS deductTime,
score.final_score AS score,
#{projectId} as projectId
#{projectId} as projectId
FROM
t_compete_count_score score,
t_compete_start_order startOrder,
@ -1160,7 +1161,8 @@
score.judgment_b_score2 AS mainTwoScore,
score.should_times AS shouldScore,
score.deduct_times AS deductTime,
score.final_score AS finalScore
score.final_score AS score,
#{projectId} as projectId
FROM
t_compete_count_score score,
t_compete_start_order startOrder,
@ -1190,8 +1192,8 @@
score.id
) t2
on 1=1
AND t1.finalScore &lt;
t2.finalScore
AND t1.score &lt;
t2.score
GROUP BY
t1.id
ORDER BY
@ -1207,8 +1209,7 @@
score.id,
score.judgment_a_score as mainOneScore,
score.judgment_b_score2 as mainTwoScore,
score.should_times as shouldScore,
score.deduct_times as score,
score.should_times as score,
#{projectId} as projectId
FROM
t_compete_count_score score,
@ -1238,8 +1239,8 @@
score.id,
score.judgment_a_score as mainOneScore,
score.judgment_b_score2 as mainTwoScore,
score.should_times as shouldScore,
score.deduct_times as deductTime
score.should_times as score,
#{projectId} as projectId
FROM
t_compete_count_score score,
t_compete_start_order startOrder,
@ -1263,8 +1264,88 @@
group by t1.id
order by t1.groupName, rangee
</select>
<select id="selectVatietyPlayer" resultType="com.ccsens.mt.bean.vo.ScoreVo$CompeteScore">
<select id="selectVarietyPlayer" resultType="com.ccsens.mt.bean.vo.ScoreVo$CompeteScore">
SELECT
s.*,
c.NAME AS companyName,
GROUP_CONCAT( p.NAME ) AS name,
#{projectId} as projectId,
convert(
(
ifnull( s.referee1, 0 )+ ifnull( s.referee2, 0 )+ ifnull( s.referee3, 0 ))/ 3 + (
ifnull( s.referee4, 0 )+ ifnull( s.referee5, 0 )+ ifnull( s.referee6, 0 ))/ 3 - ifnull(s.referee0,0),decimal(15,2))
AS score
FROM
(
SELECT
site_order_id,
max(
IF
( chief_judgment = 0, score, NULL )) AS referee0,
max(
IF
( chief_judgment = 1, score, NULL )) AS referee1,
max(
IF
( chief_judgment = 2, score, NULL )) AS referee2,
max(
IF
( chief_judgment = 3, score, NULL )) AS referee3,
max(
IF
( chief_judgment = 4, score, NULL )) AS referee4,
max(
IF
( chief_judgment = 5, score, NULL )) AS referee5,
max(
IF
( chief_judgment = 6, score, NULL )) AS referee6,
max(
IF
( chief_judgment = 7, score, NULL )) AS referee7
FROM
(
SELECT
s.site_order_id,
j.chief_judgment,
sum( s.score ) AS score
FROM
t_compete_variety_score s,
t_compete_judgment j
WHERE
s.judgment_id = j.id
AND s.project_id = #{projectId}
AND s.rec_status = 0
AND j.rec_status = 0
GROUP BY
s.site_order_id,
j.chief_judgment
) t
GROUP BY
t.site_order_id
) s,
t_compete_start_order o,
t_compete_team t,
t_compete_team_member m,
t_compete_player p,
t_compete_company c
WHERE
s.site_order_id = o.id
AND o.player_id = t.id
AND t.id = m.compete_team_id
AND m.player_id = p.id
AND p.company_id = c.id
AND o.rec_status = 0
AND t.rec_status = 0
AND m.rec_status = 0
AND p.rec_status = 0
AND c.rec_status = 0
GROUP BY
s.site_order_id
ORDER BY
score DESC
</select>
<!--<select id="queryEightGroupLimit" resultType="com.ccsens.mt.bean.vo.CompeteExcelVo$BeforeEight">

Loading…
Cancel
Save