Blame view

cloud/search_smartCampus/src/main/resources/mapper/WgUserSearchMapper.xml 2.96 KB
5efb4092   陈杰   微耕服务 嵌入分布式
1
2
<?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" >
e92e5a92   陶汉栋   增加网关负载
3
4
<mapper namespace="com.sincere.smartSearch.mapper.WgUserSearchMapper">

5efb4092   陈杰   微耕服务 嵌入分布式
5

5efb4092   陈杰   微耕服务 嵌入分布式
6
7
8
9
10
    <select id="checkLeave" parameterType="java.lang.String" resultType="java.lang.String">
        select StudentNum from HS_LeaveExaminePassList where StudentNum= #{cardNo}
        and GETDATE() <![CDATA[ > ]]> LeaveTime and GETDATE()  <![CDATA[ < ]]> ReturnTime
    </select>

e92e5a92   陶汉栋   增加网关负载
11
12
13
14
15
    <resultMap id="School" type="com.sincere.smartSearch.model.School">
        <result column="school_id" property="schoolId" jdbcType="INTEGER"/>
        <result column="manageuser_id" property="managerUserId" jdbcType="INTEGER"/>
        <result column="school_name" property="schoolName" jdbcType="VARCHAR"/>
    </resultMap>
5efb4092   陈杰   微耕服务 嵌入分布式
16

e92e5a92   陶汉栋   增加网关负载
17
    <select id="selectSchoolBySchoolId" parameterType="java.lang.Integer" resultMap="School">
7a375a4f   陈杰   智能校卫 告警服务
18
        select school_id , school_name , manageuser_id from SZ_School where school_id = #{schoolId}
e92e5a92   陶汉栋   增加网关负载
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
    </select>


    <resultMap id="User" type="com.sincere.smartSearch.model.User">
        <result column="school_id" property="schoolId" jdbcType="INTEGER"/>
        <result column="class_id" property="classId" jdbcType="INTEGER"/>
        <result column="name" property="name" jdbcType="VARCHAR"/>
        <result column="student_id" property="studentId" jdbcType="INTEGER"/>
    </resultMap>

    <select id="selectUserByCardNum" parameterType="java.lang.String" resultMap="User">
        select school_id , class_id ,name ,student_id from
        (select top 1 b.school_id, b.class_id, b.name, student_id from SZ_V_Card a
        inner join SZ_V_School_Student b on a.user_id = b.student_id
        and b.role_state = 1 where a.type = 2 and a.num = #{cardNum}
        union
        select top 1 b.school_id, 0 as class_id, b.name,b.teacher_id as student_id from SZ_V_Card a
        inner join SZ_V_School_Teacher b on a.user_id = b.teacher_id
        and b.role_state = 1 where a.type = 0 and a.num = #{cardNum}
        ) x
    </select>

    <resultMap id="UpDateCard" type="com.sincere.smartSearch.model.UpdateCard">
        <result column="ID" property="id" jdbcType="INTEGER"/>
        <result column="UserType" property="userType" jdbcType="INTEGER"/>
        <result column="oldCard" property="oldCard" jdbcType="VARCHAR"/>
5efb4092   陈杰   微耕服务 嵌入分布式
45
46
47
48
49
    </resultMap>
    <select id="selectUpdateCardByUpdateId" parameterType="java.lang.Integer" resultMap="UpDateCard">
        select ID ,UserType , OldCard from HS_StudentUpdateCard where ID = #{updateId}
    </select>

e92e5a92   陶汉栋   增加网关负载
50
51
52
    <resultMap id="StudentCard" type="com.sincere.smartSearch.model.StudentCard">
        <result column="CardType" property="cardType" jdbcType="VARCHAR"/>
        <result column="CardNum" property="cardNum" jdbcType="VARCHAR"/>
5efb4092   陈杰   微耕服务 嵌入分布式
53
54
55
56
57
    </resultMap>
    <select id="selectStudentCard" parameterType="java.lang.String" resultMap="StudentCard">
        select CardType , CardNum from HS_StudentCards where CardNum = #{cardNum}
    </select>
</mapper>