CollegeFileMapper.xml
3.33 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
108
109
110
111
112
113
114
115
116
117
118
<?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.CollegeFileMapper">
<select id="fileManagement" resultType="com.subsidy.vo.college.FileManagementVO">
SELECT
t.id,
t.NAME,
t2.summary_name,
t2.summary_url,
t2.support_file_name,
t2.support_file_url,
t2.word_report_name,
t2.word_report_url,
t2.ppt_url,
t2.ppt_name
FROM
colleges_dict t
LEFT JOIN (
SELECT
t2.id,
t2.NAME,
t.summary_name,
t.summary_url,
t.support_file_name,
t.support_file_url,
t.word_report_name,
t.word_report_url,
t.ppt_url,
t.ppt_name
FROM
college_file t
LEFT JOIN colleges_dict t2 ON t.college_id = t2.id
WHERE
t.delete_date IS NULL
AND t2.delete_date IS NULL
AND t.match_id = #{matchId}
) t2 ON t.id = t2.id
where t.delete_date is null
<if test="education != null and education != ''">
AND t.education = #{education}
</if>
<if test="name != null and name != ''">
AND t.`name` LIKE concat('%',#{name} ,'%')
</if>
</select>
<select id="collegeInfo" resultType="com.subsidy.vo.college.CollegeInfoVO">
SELECT
(
SELECT
count( 1 )
FROM
project t
WHERE
t.delete_date IS NULL
AND t.match_id = #{matchId}
AND t.college_id = #{collegeId}
AND t.project_schedule = '市级复赛'
) t1,(
SELECT
count( 1 )
FROM
project t
WHERE
t.delete_date IS NULL
AND t.match_id = #{matchId}
AND t.college_id = #{collegeId}
AND t.project_schedule = '市级决赛'
) t2,(
SELECT
count( 1 )
FROM
project t
WHERE
t.delete_date IS NULL
AND t.match_id = #{matchId}
AND t.college_id = #{collegeId}
AND t.project_status = '铜奖'
) t3,
(
SELECT
count( 1 )
FROM
project t
WHERE
t.delete_date IS NULL
AND t.match_id = #{matchId}
AND t.college_id = #{collegeId}
AND t.project_status = '银奖'
) t4,
(
SELECT
count( 1 )
FROM
project t
WHERE
t.delete_date IS NULL
AND t.match_id = #{matchId}
AND t.college_id = #{collegeId}
AND t.project_status = '金奖'
) t5
FROM
DUAL
</select>
<select id="recentFile" resultType="com.subsidy.vo.college.RecentFileVO">
SELECT
*
FROM
college_file t
WHERE
t.delete_date IS NULL
AND t.college_id = #{collegeId}
AND t.match_id = #{matchId}
</select>
</mapper>