Blame view

cloud/dahua/src/main/resources/xiaoanmapper/SearchMapper.xml 1.84 KB
9df247c3   徐泉   大华考勤需求提交
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" >
c6a8099f   徐泉   遗漏提交
3
<mapper namespace="com.example.dahua.dao.SearchDao" >
9df247c3   徐泉   大华考勤需求提交
4
5
6
7
8
9


    <resultMap id="resultMap" type="com.example.dahua.bean.CheckIn">
        <result column="arr" property="out" jdbcType="VARCHAR" />
        <result column="iscuccess" property="isSuccess" jdbcType="INTEGER" />
    </resultMap>
c6a8099f   徐泉   遗漏提交
10
11
    <insert id="checkIn" parameterType="com.example.dahua.bean.CheckIn" statementType="CALLABLE" >
        {call AttendanceService(
9df247c3   徐泉   大华考勤需求提交
12
13
14
15
16
17
           #{deviceId,mode=IN} , #{cardNo,mode=IN} , #{funNo,mode=IN}, #{flag,mode=IN} , #{checkTime,mode=IN},
           #{out,mode=OUT,jdbcType=VARCHAR,resultMap=resultMap},#{isSuccess,mode=OUT,jdbcType=INTEGER,resultMap=resultMap}
        )}
    </insert>

  <resultMap id="User" type="com.example.dahua.bean.User" >
ad296f75   徐泉   智能校卫:海康、大华人脸机代码提交
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
    <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>

</mapper>
09102d07   徐泉   修改提交

9df247c3   徐泉   大华考勤需求提交