107 lines
4.5 KiB
XML
107 lines
4.5 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.gzrn.rnbmw.push.dao.AttendancePushDao">
|
||
|
|
|
||
|
|
<select id="getAttendancePushList" resultType="com.bonus.gzrn.rnbmw.person.entity.FaceContrastBean">
|
||
|
|
SELECT a.* FROM(
|
||
|
|
SELECT if(bw.name is null,'',bw.name) as name,bwr.ID_NUMBER as idNumber,ffc.ADD_TIME,
|
||
|
|
pc.org_name as orgName,bp.name as proName,pc.id as orgId,bp.id as proId,
|
||
|
|
(ffc.WORK_HOURS + ffc.OVER_HOURS) as counts,
|
||
|
|
ffc.CURRENT_DAY as currentDay,
|
||
|
|
CASE ffc.is_push
|
||
|
|
WHEN '0' THEN '未推送'
|
||
|
|
WHEN '1' THEN '推送成功'
|
||
|
|
WHEN '2' THEN '推送失败'
|
||
|
|
END as isPush,
|
||
|
|
ffc.push_time as pushTime
|
||
|
|
FROM fc_face_contrast ffc
|
||
|
|
LEFT JOIN bm_worker_record bwr ON ffc.ID_NUMBER=bwr.ID_NUMBER
|
||
|
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER=bwr.ID_NUMBER
|
||
|
|
LEFT JOIN pm_organization o ON o.id=bwr.ORG_ID
|
||
|
|
LEFT JOIN pm_company pc ON pc.id=o.COMPANY_ID
|
||
|
|
LEFT JOIN bm_project bp ON bp.id=bwr.PROJECT_ID and bp.status = '在建'
|
||
|
|
WHERE bwr.IS_ACTIVE='1' AND bwr.examine_status='1' AND ffc.AUDIT_STATUS='1'
|
||
|
|
AND ffc.is_active='1' AND ffc.CURRENT_DAY BETWEEN #{params.startTime} AND #{params.endTime}
|
||
|
|
<if test="params.companyId != null and params.companyId !='' ">
|
||
|
|
and pc.id = #{params.companyId}
|
||
|
|
</if>
|
||
|
|
<if test="params.orgId !=null and params.orgId !=''">
|
||
|
|
and pc.id=#{params.orgId}
|
||
|
|
</if>
|
||
|
|
<if test="params.proId !=null and params.proId !=''">
|
||
|
|
and bp.id=#{params.proId}
|
||
|
|
</if>
|
||
|
|
<if test="params.keyWord !=null and params.keyWord !=''">
|
||
|
|
and (
|
||
|
|
bw.name like concat ('%',#{params.keyWord},'%') or
|
||
|
|
ffc.CURRENT_DAY like concat ('%',#{params.keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
GROUP BY bwr.ID_NUMBER,ffc.ADD_TIME
|
||
|
|
order by ffc.ADD_TIME desc
|
||
|
|
)a
|
||
|
|
where 1=1
|
||
|
|
<if test="params.isPush !=null and params.isPush !=''">
|
||
|
|
and a.isPush=#{params.isPush}
|
||
|
|
</if>
|
||
|
|
GROUP BY a.idNumber,a.currentDay
|
||
|
|
order by a.ADD_TIME desc
|
||
|
|
limit #{offset}, #{limit}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="getAttendancePushCount" resultType="java.lang.Integer">
|
||
|
|
|
||
|
|
select count(1) as num
|
||
|
|
from
|
||
|
|
(
|
||
|
|
SELECT a.* FROM(
|
||
|
|
SELECT if(bw.name is null,'',bw.name) as name,bwr.ID_NUMBER as idNumber,
|
||
|
|
pc.org_name as orgName,bp.name as proName,pc.id as orgId,bp.id as proId,
|
||
|
|
(ffc.WORK_HOURS + ffc.OVER_HOURS) as counts,
|
||
|
|
ffc.CURRENT_DAY as currentDay,
|
||
|
|
CASE ffc.is_push
|
||
|
|
WHEN '0' THEN '未推送'
|
||
|
|
WHEN '1' THEN '推送成功'
|
||
|
|
WHEN '2' THEN '推送失败'
|
||
|
|
END as isPush,
|
||
|
|
ffc.push_time as pushTime
|
||
|
|
FROM fc_face_contrast ffc
|
||
|
|
LEFT JOIN bm_worker_record bwr ON ffc.ID_NUMBER=bwr.ID_NUMBER
|
||
|
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER=bwr.ID_NUMBER
|
||
|
|
LEFT JOIN pm_organization o ON o.id=bwr.ORG_ID
|
||
|
|
LEFT JOIN pm_company pc ON pc.id=o.COMPANY_ID
|
||
|
|
LEFT JOIN bm_project bp ON bp.id=bwr.PROJECT_ID and bp.status = '在建'
|
||
|
|
WHERE bwr.IS_ACTIVE='1' AND bwr.examine_status='1' AND ffc.AUDIT_STATUS='1'
|
||
|
|
AND ffc.is_active='1' AND ffc.CURRENT_DAY BETWEEN #{params.startTime} AND #{params.endTime}
|
||
|
|
<if test="params.companyId != null and params.companyId !='' ">
|
||
|
|
and pc.id = #{params.companyId}
|
||
|
|
</if>
|
||
|
|
<if test="params.orgId !=null and params.orgId !=''">
|
||
|
|
and pc.id=#{params.orgId}
|
||
|
|
</if>
|
||
|
|
<if test="params.proId !=null and params.proId !=''">
|
||
|
|
and bp.id=#{params.proId}
|
||
|
|
</if>
|
||
|
|
|
||
|
|
<if test="params.keyWord !=null and params.keyWord !=''">
|
||
|
|
and (
|
||
|
|
bw.name like concat ('%',#{params.keyWord},'%') or
|
||
|
|
ffc.CURRENT_DAY like concat ('%',#{params.keyWord},'%')
|
||
|
|
)
|
||
|
|
</if>
|
||
|
|
GROUP BY bwr.ID_NUMBER,ffc.ADD_TIME
|
||
|
|
order by ffc.ADD_TIME desc
|
||
|
|
)a
|
||
|
|
where 1=1
|
||
|
|
<if test="params.isPush !=null and params.isPush !=''">
|
||
|
|
and a.isPush=#{params.isPush}
|
||
|
|
</if>
|
||
|
|
GROUP BY a.idNumber,a.currentDay
|
||
|
|
) res
|
||
|
|
|
||
|
|
|
||
|
|
</select>
|
||
|
|
|
||
|
|
</mapper>
|