DrawLotsScoresMapper.xml
3.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.subsidy.mapper.DrawLotsScoresMapper">
<select id="groupScores" resultType="com.subsidy.vo.group.GroupScoresVO">
SELECT
t2.id,
t2.course_name project_name,
t4.name college,
t3.id as groupId,
t.group_num,
t3.group_name,
t2.project_track
FROM
draw_lots_group_items t
LEFT JOIN project t2 ON t.project_id = t2.id
left join draw_lot_group_dict t3 on t.group_id = t3.id
left join colleges_dict t4 on t2.college_id = t4.id
WHERE
t.delete_date IS NULL
<if test="projectName != null and projectName != ''">
AND t2.course_name like concat('%', #{projectName}, '%')
</if>
and t3.scene_id = #{sceneId}
<if test="groupId != null and groupId != ''">
and t.group_id = #{groupId}
</if>
order by t3.id,t.order_no
</select>
<select id="groupJudgeScores" resultType="com.subsidy.vo.group.GroupJudgeScoresVO">
SELECT
t2.id,
t2.username,
t3.expector_type,
t3.role_type,
t.score
FROM
draw_lots_scores t
LEFT JOIN project_judge t2 ON t.judge_id = t2.id
LEFT JOIN draw_lots_group_judges t3 ON t.scene_id = t3.scene_id
AND t.judge_id = t3.judge_id and t.group_id = t3.group_id
WHERE
t.delete_date IS NULL
and t2.delete_date is null
and t3.delete_date is null
and t.submit_status in ('已提交','弃权')
and t.group_id = #{groupId}
and t.project_id = #{projectId}
</select>
<select id="queryItems" resultType="com.subsidy.vo.group.QueryItemsVO">
SELECT
t4.id,
t2.group_name,
t3.group_num,
t4.course_name project_name,
t5.submit_status,
t5.score,
t6.name college,
t7.user_name,
t4.vod_url,
t4.support_file,
t4.project_track,
t4.attachment
FROM
draw_lots_group_judges t
LEFT JOIN draw_lot_group_dict t2 ON t.group_id = t2.id
LEFT JOIN draw_lots_group_items t3 ON t.group_id = t3.group_id
LEFT JOIN project t4 ON t3.project_id = t4.id
LEFT JOIN draw_lots_scores t5 ON t.judge_id = t5.judge_id
AND t.group_id = t5.group_id and t3.project_id = t5.project_id
left join colleges_dict t6 on t4.college_id = t6.id
left join teacher t7 on t4.teacher_id = t7.id
WHERE
t.delete_date IS NULL
and t2.delete_date is null
and t3.delete_date is null
and t4.delete_date is null
and t.group_id = #{groupId}
and t.judge_id = #{judgeId}
order by t3.order_no
</select>
<select id="groupRank" resultType="com.subsidy.vo.group.GroupRankVO">
SELECT
t.id,
t2.course_name project_name,
t4.name college,
t3.group_name,
t.group_num,
t.total_score,
t5.user_name
FROM
draw_lots_group_items t
LEFT JOIN project t2 ON t.project_id = t2.id
LEFT JOIN draw_lot_group_dict t3 ON t.group_id = t3.id
left join colleges_dict t4 on t2.college_id = t4.id
left join teacher t5 on t2.teacher_id = t5.id
WHERE
t.delete_date IS NULL
AND t.group_id = #{groupId}
ORDER BY
t.total_score desc
</select>
</mapper>