CRelationshipStudentSgcMapper.xml
2.8 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
<?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.example.client.mapper.CRelationshipStudentSgcMapper">
<resultMap type="com.example.client.domain.CRelationshipStudentSgc" id="CRelationshipStudentSgcResult">
<result property="id" column="id"/>
<result property="gerdeId" column="gerde_id"/>
<result property="userId" column="user_id"/>
<result property="creatorTime" column="creator_time"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="gardeType" column="garde_type"/>
</resultMap>
<resultMap type="com.example.client.domain.vo.MySchoolVo" id="MySchoolVoResult">
<result property="id" column="id"/>
<result property="schoolName" column="school_name"/>
<result property="startDate" column="start_date"/>
<result property="endDate" column="end_date"/>
<result property="gardeType" column="garde_type"/>
</resultMap>
<select id="getSchool" resultMap="MySchoolVoResult">
SELECT
c_relationship_student_sgc.id,
c_relationship_student_sgc.start_date,
c_relationship_student_sgc.end_date,
c_relationship_student_sgc.garde_type,
c_register_school.school_name
FROM
c_relationship_student_sgc
LEFT JOIN c_register_school ON c_register_school.school_id = c_relationship_student_sgc.school_id
WHERE
c_relationship_student_sgc.user_id = #{uid}
AND c_relationship_student_sgc.audit = 3
AND c_register_school.school_type = #{type}
ORDER BY
create_time DESC;
</select>
<select id="getTraining" resultMap="MySchoolVoResult">
SELECT
c_relationship_student_sgc.id,
c_relationship_student_sgc.start_date,
c_relationship_student_sgc.end_date,
c_relationship_student_sgc.garde_type,
c_register_school.school_name
FROM
c_relationship_student_sgc
LEFT JOIN c_register_school ON c_register_school.school_id = c_relationship_student_sgc.school_id
WHERE
c_relationship_student_sgc.user_id = #{uid}
AND c_relationship_student_sgc.audit = 3
AND c_register_school.school_type = 2
ORDER BY
create_time DESC;
</select>
<select id="getMyCassl" resultType="com.example.client.domain.vo.MyTeacherVO" parameterType="long">
SELECT r.gerde_id, s.school_name FROM c_relationship_student_sgc r
LEFT JOIN c_register_school s on s.school_id =r.school_id
WHERE r.user_id = #{userId}
</select>
</mapper>