|
@ -1394,6 +1394,248 @@ |
|
|
and cp.rec_status = 0 |
|
|
and cp.rec_status = 0 |
|
|
|
|
|
|
|
|
</select> |
|
|
</select> |
|
|
|
|
|
<select id="selectCountTeam" resultType="com.ccsens.mt.bean.vo.ScoreVo$CompeteScore"> |
|
|
|
|
|
|
|
|
|
|
|
SELECT |
|
|
|
|
|
t1.*, |
|
|
|
|
|
count( t2.id ) + 1 AS rangee |
|
|
|
|
|
FROM |
|
|
|
|
|
( |
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
|
|
|
|
GROUP_CONCAT( player.NAME SEPARATOR '、' ) AS NAME, |
|
|
|
|
|
company.NAME AS companyName, |
|
|
|
|
|
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.final_score AS score, |
|
|
|
|
|
#{projectId} as projectId |
|
|
|
|
|
FROM |
|
|
|
|
|
t_compete_count_score score, |
|
|
|
|
|
t_compete_start_order startOrder, |
|
|
|
|
|
t_compete_team team, |
|
|
|
|
|
t_compete_team_member tm, |
|
|
|
|
|
t_compete_player player, |
|
|
|
|
|
t_compete_company company |
|
|
|
|
|
, |
|
|
|
|
|
t_compete_group g |
|
|
|
|
|
WHERE |
|
|
|
|
|
score.project_id = #{projectId} |
|
|
|
|
|
and g.id = #{competeGroupId} |
|
|
|
|
|
and team.gender_group = g.sex |
|
|
|
|
|
and team.group_remark = g.group_remark |
|
|
|
|
|
AND score.site_order_id = startOrder.id |
|
|
|
|
|
AND startOrder.player_id = team.id |
|
|
|
|
|
AND team.id = tm.compete_team_id |
|
|
|
|
|
AND tm.player_id = player.id |
|
|
|
|
|
AND player.company_id = company.id |
|
|
|
|
|
AND company.rec_status = 0 |
|
|
|
|
|
AND score.rec_status = 0 |
|
|
|
|
|
AND player.rec_status = 0 |
|
|
|
|
|
AND startOrder.rec_status = 0 |
|
|
|
|
|
AND team.rec_status = 0 |
|
|
|
|
|
AND tm.rec_status = 0 |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
score.id |
|
|
|
|
|
) t1 |
|
|
|
|
|
LEFT JOIN ( |
|
|
|
|
|
SELECT |
|
|
|
|
|
|
|
|
|
|
|
GROUP_CONCAT( player.NAME SEPARATOR '、' ) AS NAME, |
|
|
|
|
|
company.NAME AS companyName, |
|
|
|
|
|
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.final_score AS score, |
|
|
|
|
|
#{projectId} as projectId |
|
|
|
|
|
FROM |
|
|
|
|
|
t_compete_count_score score, |
|
|
|
|
|
t_compete_start_order startOrder, |
|
|
|
|
|
t_compete_team team, |
|
|
|
|
|
t_compete_team_member tm, |
|
|
|
|
|
t_compete_player player, |
|
|
|
|
|
t_compete_company company |
|
|
|
|
|
, |
|
|
|
|
|
t_compete_group g |
|
|
|
|
|
WHERE |
|
|
|
|
|
score.project_id = #{projectId} |
|
|
|
|
|
and g.id = #{competeGroupId} |
|
|
|
|
|
and team.gender_group = g.sex |
|
|
|
|
|
and team.group_remark = g.group_remark |
|
|
|
|
|
AND score.site_order_id = startOrder.id |
|
|
|
|
|
AND startOrder.player_id = team.id |
|
|
|
|
|
AND team.id = tm.compete_team_id |
|
|
|
|
|
AND tm.player_id = player.id |
|
|
|
|
|
AND player.company_id = company.id |
|
|
|
|
|
AND company.rec_status = 0 |
|
|
|
|
|
AND score.rec_status = 0 |
|
|
|
|
|
AND player.rec_status = 0 |
|
|
|
|
|
AND startOrder.rec_status = 0 |
|
|
|
|
|
AND team.rec_status = 0 |
|
|
|
|
|
AND tm.rec_status = 0 |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
score.id |
|
|
|
|
|
) t2 |
|
|
|
|
|
on 1=1 |
|
|
|
|
|
AND t1.score < |
|
|
|
|
|
t2.score |
|
|
|
|
|
GROUP BY |
|
|
|
|
|
t1.id |
|
|
|
|
|
ORDER BY |
|
|
|
|
|
rangee |
|
|
|
|
|
</select> |
|
|
|
|
|
<select id="selectCountPlayer" resultType="com.ccsens.mt.bean.vo.ScoreVo$CompeteScore"> |
|
|
|
|
|
select t1.*, count(t2.id) + 1 as rangee from |
|
|
|
|
|
(SELECT |
|
|
|
|
|
competeGroup.group_name as groupName, |
|
|
|
|
|
player.NAME as name, |
|
|
|
|
|
score.final_score as finalScore, |
|
|
|
|
|
p.NAME as companyName, |
|
|
|
|
|
score.id, |
|
|
|
|
|
score.judgment_a_score as mainOneScore, |
|
|
|
|
|
score.judgment_b_score2 as mainTwoScore, |
|
|
|
|
|
score.should_times as score, |
|
|
|
|
|
#{projectId} as projectId |
|
|
|
|
|
FROM |
|
|
|
|
|
t_compete_count_score score, |
|
|
|
|
|
t_compete_start_order startOrder, |
|
|
|
|
|
t_compete_project_player pp, |
|
|
|
|
|
t_compete_player player, |
|
|
|
|
|
t_compete_group competeGroup, |
|
|
|
|
|
t_compete_company p |
|
|
|
|
|
WHERE |
|
|
|
|
|
score.project_id = #{projectId} |
|
|
|
|
|
and competeGroup.id = #{competeGroupId} |
|
|
|
|
|
AND score.site_order_id = startOrder.id |
|
|
|
|
|
AND startOrder.player_id = pp.id |
|
|
|
|
|
AND pp.player_id = player.id |
|
|
|
|
|
AND player.compete_group_id = competeGroup.id |
|
|
|
|
|
and player.company_id = p.id |
|
|
|
|
|
AND score.rec_status = 0 |
|
|
|
|
|
AND player.rec_status = 0 |
|
|
|
|
|
AND startOrder.rec_status = 0 |
|
|
|
|
|
AND competeGroup.rec_status = 0)t1 |
|
|
|
|
|
left join |
|
|
|
|
|
(SELECT |
|
|
|
|
|
competeGroup.group_name as groupName, |
|
|
|
|
|
player.NAME as name, |
|
|
|
|
|
score.final_score as finalScore, |
|
|
|
|
|
p.NAME as companyName, |
|
|
|
|
|
score.id, |
|
|
|
|
|
score.judgment_a_score as mainOneScore, |
|
|
|
|
|
score.judgment_b_score2 as mainTwoScore, |
|
|
|
|
|
score.should_times as score, |
|
|
|
|
|
#{projectId} as projectId |
|
|
|
|
|
FROM |
|
|
|
|
|
t_compete_count_score score, |
|
|
|
|
|
t_compete_start_order startOrder, |
|
|
|
|
|
t_compete_project_player pp, |
|
|
|
|
|
t_compete_player player, |
|
|
|
|
|
t_compete_group competeGroup, |
|
|
|
|
|
t_compete_company p |
|
|
|
|
|
WHERE |
|
|
|
|
|
score.project_id = #{projectId} |
|
|
|
|
|
and competeGroup.id = #{competeGroupId} |
|
|
|
|
|
AND score.site_order_id = startOrder.id |
|
|
|
|
|
AND startOrder.player_id = pp.id |
|
|
|
|
|
AND pp.player_id = player.id |
|
|
|
|
|
AND player.compete_group_id = competeGroup.id |
|
|
|
|
|
and player.company_id = p.id |
|
|
|
|
|
AND score.rec_status = 0 |
|
|
|
|
|
AND player.rec_status = 0 |
|
|
|
|
|
AND startOrder.rec_status = 0 |
|
|
|
|
|
AND competeGroup.rec_status = 0)t2 |
|
|
|
|
|
on t1.groupName = t2.groupName and t1.finalScore < t2.finalScore |
|
|
|
|
|
group by t1.id |
|
|
|
|
|
order by t1.groupName, rangee |
|
|
|
|
|
</select> |
|
|
|
|
|
<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"> |
|
|
<!--<select id="queryEightGroupLimit" resultType="com.ccsens.mt.bean.vo.CompeteExcelVo$BeforeEight"> |
|
|
select t1.group_name as groupName, GROUP_CONCAT(t1.name) as eightNames from |
|
|
select t1.group_name as groupName, GROUP_CONCAT(t1.name) as eightNames from |
|
|