Blame view

cloud/user_search/src/main/resources/mapper/UserMapper.xml 4.24 KB
e2822531   陈杰   用户中心
1
2
3
4
<?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.sincere.userSearch.mapper.UserMapper">

cd21c841   陈杰   用户信息接口
5
6
    <resultMap id="TeacherInfo" type="com.sincere.userSearch.model.TeacherInfo">
        <result column="user_id" property="userId"/>
b5bd5e3f   504987307@qq.com   用户信息接口 添加数据
7
        <result column="name" property="userName"/>
cd21c841   陈杰   用户信息接口
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
        <result column="mobile" property="mobile"/>
        <result column="face" property="face"/>
        <result column="pass" property="pass"/>
        <result column="schoolid" property="schoolId"/>
        <result column="schoolname" property="schoolName"/>
        <collection property="classInfos" ofType="com.sincere.userSearch.model.TeacherClassInfo">
            <result column="classid" property="classId"/>
            <result column="classname" property="className"/>
            <result column="subjectid" property="subjectId"/>
            <result column="subjectname" property="subjectName"/>
            <result column="usertype" property="userType"/>
            <result column="TeacherId" property="teacherId"/>
            <result column="grade" property="grade"/>
            <result column="gradename" property="gradeName"/>
        </collection>
    </resultMap>
e2822531   陈杰   用户中心
24
    <select id="selectTeacherInfo" parameterType="java.lang.String" resultMap="TeacherInfo">
cd21c841   陈杰   用户信息接口
25
        SELECT u.user_id , u.name , u.mobile , u.face  , u.pass, s.school_id AS schoolid, s.numType, s.school_name AS schoolname,s.school_area as schoolArea,
e92e5a92   陶汉栋   增加网关负载
26
27
28
29
30
31
32
33
34
35
36
37
38
      c.class_id AS classid, c.class_name AS classname,
      sj.subject_id AS subjectid, sj.subject_name AS subjectname, sj.subId as SysSubjectId,
      ur.usertype, ur.customerId AS TeacherId,c.grade AS grade,(SELECT grade FROM dbo.SZ_Grade WHERE id=c.grade) gradename
       FROM    dbo.SZ_UserRole ur
       join sz_user u on ur.user_id = u.user_id
       INNER JOIN dbo.SZ_School s ON s.school_id = ur.school_id AND ur.isconfirm=1
       LEFT JOIN dbo.SZ_Class c ON (c.state=1 AND ur.school_id = c.school_id AND c.class_id=ur.class_id AND c.is_finish=0)
       LEFT JOIN dbo.SZ_Subject sj ON sj.subject_id=ur.subject_id
       WHERE   ur.usertype not in (2,3,33,34) AND ur.state=1 AND ur.user_id=#{userId} order by ur.class_id desc
    </select>


    <resultMap id="StudentInfo" type="com.sincere.userSearch.model.StudentInfo">
e2822531   陈杰   用户中心
39
40
        <result column="user_id" property="userId"/>
        <result column="student_id" property="studentId"/>
b5bd5e3f   504987307@qq.com   用户信息接口 添加数据
41
42
43
44
45
46
        <result column="name" property="studentName"/>
        <result column="school_id" property="schoolId"/>
        <result column="school_name" property="schoolName"/>
        <result column="photo" property="face"/>
        <result column="pass" property="pass"/>
        <result column="othername" property="otherName"/>
e92e5a92   陶汉栋   增加网关负载
47
48
        <result column="studentcode" property="studentCode"/>
        <result column="class_id" property="classId"/>
b5bd5e3f   504987307@qq.com   用户信息接口 添加数据
49
        <result column="class_name" property="className"/>
e92e5a92   陶汉栋   增加网关负载
50
51
52
    </resultMap>
    <select id="selectStudentInfo" parameterType="java.lang.String" resultMap="StudentInfo">
        select sz_v_school_student.* , sz_school.school_name from sz_v_school_student join sz_school
b5bd5e3f   504987307@qq.com   用户信息接口 添加数据
53
        on sz_v_school_student.school_id = sz_school.school_id  where user_id = #{userId}
e92e5a92   陶汉栋   增加网关负载
54
    </select>
b5bd5e3f   504987307@qq.com   用户信息接口 添加数据
55

cd21c841   陈杰   用户信息接口
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

    <resultMap id="ParentInfo" type="com.sincere.userSearch.model.StudentInfo">
        <result column="user_id" property="parentUserId"/>
        <result column="mobile" property="parentMobile"/>
        <result column="name" property="parentName"/>
        <result column="pass" property="parentPass"/>
    </resultMap>
    <select id="selectParentInfo" parameterType="java.lang.Integer"  resultMap="ParentInfo">
        select sz_user.user_id , sz_user.name ,sz_user.pass ,sz_user.mobile from sz_user where user_id = (
            select user_id from sz_userRole where customerid =
            (select parent_id from SZ_SPRole where student_id = #{studentId}))
    </select>



    <select id="selectChildrenId" parameterType="java.lang.String" resultType="java.lang.String">
e92e5a92   陶汉栋   增加网关负载
72
        select user_id from SZ_UserRole where state = 1 and  CustomerId in (
cd21c841   陈杰   用户信息接口
73
74
75
76
        select student_id from SZ_SPRole where parent_id in (
        select DISTINCT customerId  from SZ_UserRole where user_id = #{userId} and UserType = 3))
    </select>
</mapper>
e92e5a92   陶汉栋   增加网关负载

cd21c841   陈杰   用户信息接口

e92e5a92   陶汉栋   增加网关负载

cd21c841   陈杰   用户信息接口

cd21c841   陈杰   用户信息接口

e92e5a92   陶汉栋   增加网关负载

cd21c841   陈杰   用户信息接口

e92e5a92   陶汉栋   增加网关负载

cd21c841   陈杰   用户信息接口

e2822531   陈杰   用户中心