62 lines
3.0 KiB
XML
62 lines
3.0 KiB
XML
<?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.bonus.attendance.att.dao.AttendanceMachineDao">
|
|
|
|
<select id="selectAttendanceMachinePushList"
|
|
resultType="com.bonus.attendance.att.entity.PersonComprehensiveBean">
|
|
select bam.id, bamp.id_number as idNumber, bw.name, operate,
|
|
face_base64 as faceImg, face_path as facePath
|
|
from bm_attendance_machine bam
|
|
left join bm_attendance_machine_push bamp on bamp.attendance_machine_id = bam.id and is_push = 0
|
|
left join bm_worker bw on bw.id_number = bamp.id_number
|
|
where bam.is_active = 1 and bam.attendance_machine_id = #{sn} and bamp.id_number is not null
|
|
limit 5
|
|
</select>
|
|
|
|
<update id="updatePushStatus">
|
|
<foreach collection="list" item="param" index="index">
|
|
update bm_attendance_machine_push set is_push = 1, push_content = #{param.content}
|
|
where id_number = #{param.idNumber} and attendance_machine_id = #{param.id}
|
|
and operate = #{param.operate};
|
|
</foreach>
|
|
</update>
|
|
|
|
<insert id="insertAttendance">
|
|
insert into fc_face_contrast(IMEI,upload_id,ID_NUMBER,PRO_ID,CURRENT_DAY,ADD_TIME,PHOTO_PATH,attendance_type,lon,lat,is_red_att)
|
|
values(#{imei},#{userId},#{idNumber},#{proId},#{currentDay},#{addTime},#{photoPath},#{uploadType},#{lon},#{lat},#{isRedAtt})
|
|
</insert>
|
|
|
|
<insert id="uploadPersonEinStatus">
|
|
replace into bm_worker_ein_history(id_number,ein_time,project_id,sub_id,team_id,post_id,contract_id)
|
|
values(#{idNumber},#{einTime},#{proId},#{subId},#{teamId},#{postId},#{contractId});
|
|
update bm_worker set ein_status = 1 where id_number = #{idNumber}
|
|
</insert>
|
|
|
|
<select id="selectWorkPerson" resultType="com.bonus.attendance.att.entity.BasePersonBean">
|
|
SELECT bw.NAME,bw.id_number AS idNumber,bw.post_id as postId,ein_status as einStatus,
|
|
IFNULL(bsc.pro_id, bweh.project_id) as proId,bsc.sub_id as subId,btur.team_id as teamId,
|
|
bwc.id as contractId, bw.light_status as lightStatus,
|
|
IFNULL(toWork.add_time, 0) as isToWork,
|
|
bw.is_furlough_person as isFurloughPerson,
|
|
IFNULL(bweh.id_number, '-1') as isEinStatus
|
|
FROM bm_worker bw
|
|
left join bm_worker_ein_history bweh on bweh.id_number = bw.id_number and bweh.is_active = 1
|
|
LEFT JOIN t_dict t ON t.id = bw.post_id AND t.is_active = 1
|
|
left join bm_team_user_relation btur on btur.id_number = bw.id_number and btur.is_active = 1
|
|
left join bm_sub_relation bsr on bsr.value = btur.team_id and bsr.is_active = 1 and bsr.type = 3
|
|
LEFT JOIN bm_sub_contract bsc ON bsc.id = bsr.sub_contract_id and bsc.is_active = 1
|
|
left join bm_worker_contract bwc on bwc.idCard = bw.id_number and bwc.is_active = 1
|
|
left join
|
|
(select * from(
|
|
select id_number,add_time from fc_face_contrast where
|
|
CURRENT_DAY = #{date} and attendance_type = 1
|
|
ORDER BY ADD_TIME ASC limit 1000000000000
|
|
) a GROUP BY a.id_number
|
|
) toWork on toWork.ID_NUMBER = bw.id_number
|
|
WHERE bw.IS_ACTIVE = 1
|
|
and bw.id_number = #{idNumber}
|
|
GROUP BY bw.id_number
|
|
</select>
|
|
|
|
</mapper> |