叶松
2023-10-30 6a9372d8683ccff59efdecde0792938e774b7e3a
hd/pipe/StaffManage/src/main/resources/mapping/PlatUserMapper.xml
@@ -858,14 +858,19 @@
    <select id="queryDoorUser" resultType="com.thhy.staff.modules.biz.platuser.entity.DoorUserVo">
        select fr.create_time,fr.employee_no_string as jobNum,spu.real_name as realName,sg.group_name as groupName,1 as staffStatus
        select fr.id,fr.create_time,fr.employee_no_string as userId,fd.through_type,spu.real_name as realName,spu.job_num as jobNum,sg.group_name as groupName,1 as staffStatus
        from t_face_record fr
                 left join sys_plat_user spu on spu.job_num = fr.employee_no_string
                 left join t_face_device fd on fd.dev_sno = fr.mac_address
                 left join sys_plat_user spu on spu.user_id = fr.employee_no_string
                 left join sys_group_user sgu on spu.user_id = sgu.user_id
                 left join sys_group sg on sg.group_id = sgu.group_id
        where fr.notice_type = 5 and fr.verify = 1 and (fr.mac_address='e0:ca:3c:f0:d9:3a' or fr.mac_address = 'e0:ca:3c:f0:a7:34' or fr.mac_address = 'e0:ca:3c:f0:d9:3b')
        where fr.verify = 1 and fd.through_type = 2
        order by fr.create_time desc
        limit 10
    </select>
    <select id="queryOriStrById" resultType="string">
        select ori_str from t_face_record where id = #{id}
    </select>
    <select id="countInDoorUserToday" resultType="int">
@@ -907,7 +912,7 @@
    </select>
    <select id="queryUserFaceSingle" resultType="com.thhy.staff.modules.biz.face.entity.UserFaceVo">
        select user_id as userId,real_name as realName,sex,photo as templateImgUrl
        select user_id as userId,real_name as realName,sex,photo
        from sys_plat_user spu
        where user_id = #{userId}
    </select>
@@ -925,4 +930,40 @@
        update sys_plat_user set sync_success = 2,sync_fail_reason = #{syncFailReason} where user_id = #{userId}
    </update>
    <select id="countByFaceId" resultType="int">
        select count(user_id) from sys_plat_user where face_id = #{faceId}
    </select>
    <insert id="insertSamplePlatUser">
        insert into sys_plat_user
        <trim prefix="(" suffixOverrides="," suffix=")">
            <if test="userId != null and userId != ''">
                user_id,
            </if>
            <if test="realName != null and realName != ''">
                real_name,
            </if>
            <if test="faceId != null and faceId != ''">
                face_id,
            </if>
            <if test="idNo != null and idNo != ''">
                id_no,
            </if>
        </trim>
        <trim prefix="values (" suffixOverrides="," suffix=")">
            <if test="userId != null and userId != ''">
                #{userId},
            </if>
            <if test="realName != null and realName != ''">
                #{realName},
            </if>
            <if test="faceId != null and faceId != ''">
                #{faceId},
            </if>
            <if test="idNo != null and idNo != ''">
                #{idNo},
            </if>
        </trim>
    </insert>
</mapper>