DrawLotsGroupItemsMapper.xml
2.13 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
<?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.DrawLotsGroupItemsMapper">
<select id="allGroupItems" resultType="com.subsidy.vo.group.AllGroupItemsVO">
SELECT
t2.id,
t2.course_name project_name,
t5.name college,
t4.group_name,
t3.user_name `name`
FROM
draw_lots_group_items t
LEFT JOIN project t2 ON t.project_id = t2.id
LEFT JOIN teacher t3 ON t2.teacher_id = t3.id
left join draw_lot_group_dict t4 on t.group_id = t4.id
left join colleges_dict t5 on t2.college_id = t5.id
WHERE
t.delete_date IS NULL
<if test="projectName != null and projectName != ''">
AND (t2.course_name LIKE concat('%', #{projectName}, '%')
OR t5.name LIKE concat('%', #{projectName}, '%'))
</if>
<if test="college != null and college != ''">
and t5.name = #{college}
</if>
<if test="groupId != null">
and t.group_id =#{groupId}
</if>
order by t.order_no
</select>
<select id="collegeProjects" resultType="com.subsidy.vo.group.CollegeProjectsVO">
SELECT
t2.id,
t2.course_name project_name,
t4.name college,
t5.user_name
FROM
project t2
left join colleges_dict t4 on t2.college_id = t4.id
left join teacher t5 on t2.teacher_id = t5.id
WHERE
t2.delete_date IS NULL
and t2.match_id = #{matchId}
<if test="college != null and college != ''">
AND (t4.name LIKE concat('%', #{college}, '%') or t2.course_name LIKE concat('%', #{college}, '%') )
</if>
and t2.project_schedule not in ('报名阶段','校内报名')
<if test="projectSchedule != null and projectSchedule != ''">
and t2.project_schedule = #{projectSchedule}
</if>
AND t2.id not in (select project_id from draw_lots_group_items t where t.delete_date is null and t.group_id != #{groupId})
</select>
</mapper>