usermapper.xml
4.25 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?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.haikangface.dao.UserDao">
<!--<select id="getStudentNum" resultType="String" parameterType="String">-->
<!--select student_num-->
<!--from SZ_V_School_Student-->
<!--where school_id = #{school_id}-->
<!--and studentcode = #{studentcode}-->
<!--</select>-->
<select id="getStudentWiSidAndSex" resultType="java.lang.String">
select student_num from SZ_V_School_Student where school_id = #{schoolId} and sex in
<foreach collection="sexs" item="sex" index="index" open="(" separator="," close=")">
#{sex}
</foreach>
</select>
<select id="getStudentCard" resultType="java.lang.String">
select distinct student_num from SZ_V_School_Student where school_id = #{schoolId} and student_type = #{studentType}
and sex in
<foreach item="item" collection="sex" separator="," open="(" close=")" index="">
#{item}
</foreach>
</select>
<select id="getDeviceRoomRelation" resultType="java.lang.String">
select clint_id from SZ_DeviceRoomRelation where clint_id = #{clint_id} and state = 1;
</select>
<insert id="insertBaiduFaceRecorder" parameterType="com.sincere.haikangface.bean.BaiduFaceRecorder">
insert into BaiduFaceRecorder values (#{name},#{userId},#{score},#{time},#{uploadImgUrl},#{userImgUrl})
</insert>
<insert id="insertAuthRecord" parameterType="com.sincere.haikangface.bean.face.DeviceAuthRecord">
insert into AC_DeviceAuthRecord
(ShiDuan ,StudentType, SchoolId , Sno,StartTime , EndTime , State , WeekDays ,Sex,GrantState,AuthType,aType)
values
(#{shiduan},#{studentType}, #{schoolId}, #{sno}, #{startTime}, #{endTime}, 1, #{weekDays}, #{sex}, #{grantState},#{authType},#{aType})
</insert>
<select id="getAuthRecord" resultType="com.sincere.haikangface.bean.face.DeviceAuthRecord" parameterType="java.lang.Integer">
select * from AC_DeviceAuthRecord where id = #{id}
</select>
<select id="getAuthRecordBySchoolId" resultType="java.lang.Integer">
select top 1 ShiDuan from AC_DeviceAuthRecord where SchoolId = #{schoolId} and StudentType = #{studentType}
<if test="status != null">
and State= #{status}
</if>
order by ShiDuan desc
</select>
<update id="deleteAuthRecord">
update AC_DeviceAuthRecord set State = 0 where id = #{id}
</update>
<update id="updateAuthRecord">
update AC_DeviceAuthRecord set GrantState = #{grantState} where id = #{id}
</update>
<select id="getStudentCByUserId" resultType="com.sincere.haikangface.bean.StudentBean" parameterType="java.lang.String">
select Top(1) * from SZ_V_School_Student where user_id = #{userId}
</select>
<select id="getTeacherByUserId" resultType="com.sincere.haikangface.bean.StudentBean" parameterType="java.lang.String">
select Top(1) * from SZ_V_School_Teacher where user_id = #{userId}
</select>
<select id="getStudentList" resultType="com.sincere.haikangface.bean.StudentBean">
select * from SZ_V_School_Student where school_id = #{schoolId}
<if test="studentType != null">
and student_type = #{studentType}
</if>
<if test="sex != null and sex.size() >0">
and sex in
<foreach item="item" collection="sex" separator="," open="(" close=")" index="">
#{item}
</foreach>
</if>
and (student_num is not null or student_num != '') and (photo is not null or photo !='')
</select>
<select id="getTeacherList" resultType="com.sincere.haikangface.bean.StudentBean">
select * from SZ_V_School_Teacher where school_id = #{schoolId}
and (teacher_num is not null or teacher_num !='')
and (face is not null or face !='')
</select>
<select id="getDeviceIds" resultType="java.lang.String">
select clint_id from SZ_Attendance where clint_type in(22,18,28,29) and school_id = #{schoolId}
<if test="deviceId != null and deviceId.trim() != ''">
and clint_id = #{deviceId}
</if>
</select>
</mapper>