kongzy
2024-01-29 983bdb5b89932b38d08a11ad1eed6ea89d1597e1
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
<?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.gkhy.assess.system.mapper.AssFaceRecognitionMapper">
    <resultMap type="com.gkhy.assess.system.domain.AssFaceRecognition" id="faceRecognitionResult">
        <id     property="id"        column="id"         />
        <result property="personId"     column="person_id"      />
        <result property="projectId"     column="project_id"      />
        <result property="signPath"     column="sign_path"      />
        <result property="insurancePicId"     column="insurance_pic_id"      />
        <result property="delFlag"     column="del_flag"      />
        <result property="version"     column="version"      />
        <result property="createBy"     column="create_by"      />
        <result property="createTime"     column="create_time"      />
        <result property="updateBy"     column="update_by"      />
        <result property="updateTime"     column="update_time"      />
        <result property="remark"     column="remark"      />
        <association property="faceRecord" javaType="com.gkhy.assess.system.domain.AssFaceRecord" resultMap="faceRecordesult" />
        <association property="person" javaType="com.gkhy.assess.system.domain.SysUser" resultMap="userResult" />
    </resultMap>
 
    <resultMap id="faceRecordesult" type="com.gkhy.assess.system.domain.AssFaceRecord">
        <id     property="id"       column="person_id"        />
        <result property="facePath"     column="face_path"      />
        <result property="updateTime"      column="face_time"       />
    </resultMap>
 
    <resultMap id="userResult" type="com.gkhy.assess.system.domain.SysUser">
        <id     property="id"       column="person_id"        />
        <result property="name"     column="person_name"      />
        <result property="major"      column="person_major"       />
        <result property="phone"      column="person_phone"       />
        <result property="post"      column="person_post"       />
        <result property="level"      column="person_level"       />
    </resultMap>
 
    <sql id="selectFaceRecognitionVo">
        select f.id,f.person_id,f.project_id,f.sign_path,f.insurance_pic_id,
               f.version,f.del_flag,f.create_by,f.create_time,f.update_by,f.update_time,f.remark,
               u.name as person_name,u.major as person_major,u.phone as person_phone,u.post as person_post,u.level as person_level,
               a.face_path,a.update_time as face_time
        from ass_face_recognition f
        left join sys_user u on u.id=f.person_id
        left join ass_face_record a on a.person_id=f.person_id
 
    </sql>
 
 
 
    <select id="getCountByProjectId" resultType="java.lang.Integer" parameterType="java.lang.Long">
        select count(1) from ass_face_recognition where project_id=#{projectId} and del_flag=0
 
    </select>
 
    <select id="getFaceRecognitionByProjectId" resultMap="faceRecognitionResult">
        <include refid="selectFaceRecognitionVo"/>
        where f.project_id=#{projectId} and f.del_flag=0 and a.del_flag=0
    </select>
 
    <select id="getFaceRecognitionById" resultMap="faceRecognitionResult">
        <include refid="selectFaceRecognitionVo"/>
        where f.id=#{faceRecognitionId} and a.del_flag=0
    </select>
 
    <select id="getFaceRecognitionCount" resultType="java.lang.Integer">
        select count(1) from ass_face_recognition where project_id=#{projectId} and del_flag=0
    </select>
 
</mapper>