AttendanceMapper.xml
2.54 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
<?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.smartSearch.mapper.AttendaceMapper">
    <resultMap id="BaseResultMap" type="com.sincere.common.dto.smartCampus.SZ_AttendanceDto">
        <id column="clint_id" property="clint_id"/>
        <result column="name" property="name"/>
        <result column="clint_type" property="clint_type"/>
        <result column="intime" property="intime"/>
        <result column="school_id" property="school_id"/>
        <result column="isConnection" property="isConnection"/>
        <result column="state" property="state"/>
        <result column="IsKaoqin" property="IsKaoqin"/>
        <result column="OutOrIn" property="outOrIn"/>
    </resultMap>
    <select id="selectDevice" resultMap="BaseResultMap">
        select * from SZ_Attendance where clint_id = #{client_id}
    </select>
    <select id="getAttensWithIsKaoqin" resultMap="BaseResultMap">
        select * from SZ_Attendance where IsKaoqin = #{IsKaoqin}
    </select>
    <insert id="insertAttendance" parameterType="com.sincere.common.dto.smartCampus.SZ_AttendanceDto">
        insert into SZ_Attendance(clint_id , clint_type , ip , port , intime ,school_id , state)
        values (#{clint_id},#{clint_type},#{ip} , #{port},#{intime},#{school_id},#{state})
    </insert>
    <update id="updateAttendance" parameterType="java.lang.String">
        update SZ_Attendance set lastlogin_time = GETDATE() , isConnection = 1 where clint_id = #{clint_id}
    </update>
    <select id="selectRoomAttendance" parameterType="java.lang.Integer" resultType="java.lang.String">
        select KaoQinAttendance from XA_PlaceAttendance where PlaceId = #{placeId} and (len(KanBanAttendance)>0 and KanBanAttendance is not null )
    </select>
    <select id="selectCloudAttendance" resultType="java.lang.Integer">
        select DISTINCT school_id from SZ_Attendance where school_id != -1 and ( clint_type = 18 or clint_type = 22 or
        clint_id like '253%' )
    </select>
    <select id="selectCloudAttendanceBySchoolId" parameterType="java.lang.Integer" resultMap="BaseResultMap">
        select * from SZ_Attendance where school_id = #{schoolId} and ( clint_type = 18 or clint_type = 22 or clint_id
        like '253%' )
    </select>
    <select id="selectPlaceAttendance" parameterType="java.lang.String" resultType="java.lang.String">
        select Top(1) PlaceId from XA_PlaceAttendance where KaoQinAttendance = #{deviceId}
    </select>
</mapper>