考勤模块SQL重新写
This commit is contained in:
parent
63bc317944
commit
7a6ad8b80a
|
|
@ -48,8 +48,7 @@ public class FaceContrastController {
|
||||||
}, new PageTableHandler.ListHandler() {
|
}, new PageTableHandler.ListHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<FaceContrastBean> list(PageTableRequest request) {
|
public List<FaceContrastBean> list(PageTableRequest request) {
|
||||||
List<FaceContrastBean> list = service.getWorkAttendanceList (request.getParams(), request.getOffset(), request.getLimit());
|
return service.getWorkAttendanceList (request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
}).handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,9 +84,6 @@ public class FaceContrastNewController {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return new PageTableHandler(new PageTableHandler.CountHandler() {
|
return new PageTableHandler(new PageTableHandler.CountHandler() {
|
||||||
@Override
|
@Override
|
||||||
public int count(PageTableRequest request) {
|
public int count(PageTableRequest request) {
|
||||||
|
|
@ -95,8 +92,7 @@ public class FaceContrastNewController {
|
||||||
}, new PageTableHandler.ListHandler() {
|
}, new PageTableHandler.ListHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<FaceContrastNewBean> list(PageTableRequest request) {
|
public List<FaceContrastNewBean> list(PageTableRequest request) {
|
||||||
List<FaceContrastNewBean> list = service.getWorkAttendanceList (request.getParams(), request.getOffset(), request.getLimit());
|
return service.getWorkAttendanceList (request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
}).handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
@ -124,8 +120,7 @@ public class FaceContrastNewController {
|
||||||
}, new PageTableHandler.ListHandler() {
|
}, new PageTableHandler.ListHandler() {
|
||||||
@Override
|
@Override
|
||||||
public List<FaceContrastNewBean> list(PageTableRequest request) {
|
public List<FaceContrastNewBean> list(PageTableRequest request) {
|
||||||
List<FaceContrastNewBean> list = service.getAttendanceBySubComList (request.getParams(), request.getOffset(), request.getLimit());
|
return service.getAttendanceBySubComList (request.getParams(), request.getOffset(), request.getLimit());
|
||||||
return list;
|
|
||||||
}
|
}
|
||||||
}).handle(request);
|
}).handle(request);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -421,8 +421,6 @@ public class FaceContrastNewServiceImp implements FaceContrastNewService {
|
||||||
List<FaceContrastNewBean> attList = dao.getWorkAttListByCom(params, offset, limit);
|
List<FaceContrastNewBean> attList = dao.getWorkAttListByCom(params, offset, limit);
|
||||||
for (int i = 0; i < attList.size(); i++) {
|
for (int i = 0; i < attList.size(); i++) {
|
||||||
list.get(i).setAttPersonNum(attList.get(i).getAttPersonNum());
|
list.get(i).setAttPersonNum(attList.get(i).getAttPersonNum());
|
||||||
//将临时人员的数量加到班组人员里面
|
|
||||||
list.get(i).setAllPersonNum(list.get(i).getAllPersonNum() + attList.get(i).getTempWorkerNum());
|
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
@ -435,7 +433,7 @@ public class FaceContrastNewServiceImp implements FaceContrastNewService {
|
||||||
|
|
||||||
//考勤数据较慢单独查
|
//考勤数据较慢单独查
|
||||||
//11.30添加无班组考勤人员
|
//11.30添加无班组考勤人员
|
||||||
if (attendanceByProList.size() > 0) {
|
if (!attendanceByProList.isEmpty()) {
|
||||||
List<Integer> attList = dao.getWorkAttListByPro(params);
|
List<Integer> attList = dao.getWorkAttListByPro(params);
|
||||||
for (int i = 0; i < attList.size(); i++) {
|
for (int i = 0; i < attList.size(); i++) {
|
||||||
attendanceByProList.get(i).setAttPersonNum(attList.get(i));
|
attendanceByProList.get(i).setAttPersonNum(attList.get(i));
|
||||||
|
|
@ -469,22 +467,22 @@ public class FaceContrastNewServiceImp implements FaceContrastNewService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (FaceContrastNewBean faceContrastNewBean : attendanceByProList) {
|
// for (FaceContrastNewBean faceContrastNewBean : attendanceByProList) {
|
||||||
//查出班组人中连续七天未打卡的人数
|
// //查出班组人中连续七天未打卡的人数
|
||||||
List<MapBean> currentDayList = dao.getTeamSevenNoAttPersonNum(faceContrastNewBean);
|
// List<MapBean> currentDayList = dao.getTeamSevenNoAttPersonNum(faceContrastNewBean);
|
||||||
Map<String, List<MapBean>> collect = currentDayList.stream().sorted(Comparator.comparing(MapBean::getName).reversed()).collect(Collectors.groupingBy(MapBean::getId));
|
// Map<String, List<MapBean>> collect = currentDayList.stream().sorted(Comparator.comparing(MapBean::getName).reversed()).collect(Collectors.groupingBy(MapBean::getId));
|
||||||
AtomicInteger i = new AtomicInteger();
|
// AtomicInteger i = new AtomicInteger();
|
||||||
collect.forEach((k, v) -> {
|
// collect.forEach((k, v) -> {
|
||||||
for (MapBean mapBean : v) {
|
// for (MapBean mapBean : v) {
|
||||||
long betweenDay = DateUtil.between(DateUtil.parse(mapBean.getName()), DateUtil.parse(DateUtil.today()), DateUnit.DAY);
|
// long betweenDay = DateUtil.between(DateUtil.parse(mapBean.getName()), DateUtil.parse(DateUtil.today()), DateUnit.DAY);
|
||||||
if (betweenDay > 6) {
|
// if (betweenDay > 6) {
|
||||||
i.getAndIncrement();
|
// i.getAndIncrement();
|
||||||
}
|
// }
|
||||||
break;
|
// break;
|
||||||
}
|
// }
|
||||||
});
|
// });
|
||||||
faceContrastNewBean.setSevenNoAttPersonNum(i.get());
|
// faceContrastNewBean.setSevenNoAttPersonNum(i.get());
|
||||||
}
|
// }
|
||||||
|
|
||||||
return attendanceByProList;
|
return attendanceByProList;
|
||||||
}
|
}
|
||||||
|
|
@ -524,9 +522,9 @@ public class FaceContrastNewServiceImp implements FaceContrastNewService {
|
||||||
x = x / 2.0;
|
x = x / 2.0;
|
||||||
double furloughDays = 0.0;
|
double furloughDays = 0.0;
|
||||||
double notWorkDay = 0.0;
|
double notWorkDay = 0.0;
|
||||||
if (furloughList.size() > 0) {
|
if (!furloughList.isEmpty()) {
|
||||||
List<AttDateBean> attDateBeans = furloughList.get(childObj.get(0).getIdNumber());
|
List<AttDateBean> attDateBeans = furloughList.get(childObj.get(0).getIdNumber());
|
||||||
if (attDateBeans != null && attDateBeans.size() > 0) {
|
if (attDateBeans != null && !attDateBeans.isEmpty()) {
|
||||||
for (AttDateBean attDateBean : attDateBeans) {
|
for (AttDateBean attDateBean : attDateBeans) {
|
||||||
double ofTwoDays = getDiffOfTwoDays(attDateBean.getStartDate(), attDateBean.getStopDate());
|
double ofTwoDays = getDiffOfTwoDays(attDateBean.getStartDate(), attDateBean.getStopDate());
|
||||||
furloughDays += ofTwoDays;
|
furloughDays += ofTwoDays;
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
COUNT(DISTINCT if(bp.pro_status = 2,bp.id,null)) as makeProNum,
|
COUNT(DISTINCT if(bp.pro_status = 2,bp.id,null)) as makeProNum,
|
||||||
COUNT(DISTINCT if(bp.pro_status = 1,bp.id,null)) as endProNum,
|
COUNT(DISTINCT if(bp.pro_status = 1,bp.id,null)) as endProNum,
|
||||||
COUNT(DISTINCT bs.id) as subNum,
|
COUNT(DISTINCT bs.id) as subNum,
|
||||||
COUNT(DISTINCT btur.team_id) as teamNum,
|
COUNT(DISTINCT bst.id) as teamNum,
|
||||||
COUNT(DISTINCT bw.id_number) as allPersonNum
|
COUNT(DISTINCT bw.id_number) as allPersonNum
|
||||||
FROM
|
FROM
|
||||||
( SELECT id,`name` FROM bm_project_general WHERE is_active = '1'
|
( SELECT id,`name` FROM bm_project_general WHERE is_active = '1'
|
||||||
|
|
@ -39,9 +39,12 @@
|
||||||
<if test="params.subId != null and params.subId !='' ">
|
<if test="params.subId != null and params.subId !='' ">
|
||||||
AND bs.id = #{params.subId}
|
AND bs.id = #{params.subId}
|
||||||
</if>
|
</if>
|
||||||
LEFT JOIN bm_sub_relation bsr on bsr.sub_contract_id = bsc.id and bsr.type = '3' and bsr.is_active = '1'
|
LEFT JOIN bm_sub_team bst on bs.id = bst.sub_id and bs.is_active = '1'
|
||||||
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bsr.`value` and btur.is_active = '1'
|
Left Join bm_worker_ein_history bweh on bweh.team_id = bst.id and bweh.project_id = bp.id and bweh.exit_time is null and bweh.exit_status = -1
|
||||||
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = btur.ID_NUMBER and bw.is_active = '1' and worker_type = '1'
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bweh.ID_NUMBER and bw.is_active = '1'
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND bw.worker_type = #{params.workerType}
|
||||||
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
pm.id
|
pm.id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|
@ -62,7 +65,10 @@
|
||||||
AND bp.is_active = '1'
|
AND bp.is_active = '1'
|
||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT fc.id_number, fc.pro_id FROM fc_face_contrast fc
|
SELECT fc.id_number, fc.pro_id FROM fc_face_contrast fc
|
||||||
LEFT JOIN bm_worker bw on bw.id_number = fc.ID_NUMBER and bw.worker_type = '1'
|
LEFT JOIN bm_worker bw on bw.id_number = fc.ID_NUMBER
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND bw.worker_type = #{params.workerType}
|
||||||
|
</if>
|
||||||
WHERE fc.CURRENT_DAY = #{params.startTime} GROUP BY fc.id_number, fc.CURRENT_DAY
|
WHERE fc.CURRENT_DAY = #{params.startTime} GROUP BY fc.id_number, fc.CURRENT_DAY
|
||||||
) ffc ON ffc.pro_id = bp.id
|
) ffc ON ffc.pro_id = bp.id
|
||||||
GROUP BY
|
GROUP BY
|
||||||
|
|
@ -237,7 +243,7 @@
|
||||||
bp.NAME AS proName,
|
bp.NAME AS proName,
|
||||||
bp.pro_status AS proStatus,
|
bp.pro_status AS proStatus,
|
||||||
COUNT( DISTINCT bs.id ) AS subNum,
|
COUNT( DISTINCT bs.id ) AS subNum,
|
||||||
COUNT( DISTINCT btur.team_id ) AS teamNum,
|
COUNT( DISTINCT bst.id ) AS teamNum,
|
||||||
COUNT( DISTINCT bw.id_number ) AS allPersonNum
|
COUNT( DISTINCT bw.id_number ) AS allPersonNum
|
||||||
FROM
|
FROM
|
||||||
( SELECT id, `name` FROM bm_project_general WHERE id = #{params.orgId} ) pm
|
( SELECT id, `name` FROM bm_project_general WHERE id = #{params.orgId} ) pm
|
||||||
|
|
@ -250,15 +256,13 @@
|
||||||
<if test="params.subId != null and params.subId !='' ">
|
<if test="params.subId != null and params.subId !='' ">
|
||||||
AND bs.id = #{params.subId}
|
AND bs.id = #{params.subId}
|
||||||
</if>
|
</if>
|
||||||
LEFT JOIN bm_sub_relation bsr ON bsr.sub_contract_id = bsc.id
|
LEFT JOIN bm_sub_team bst on bs.id = bst.sub_id and bs.is_active = '1'
|
||||||
AND bsr.type = '3'
|
Left Join bm_worker_ein_history bweh on bweh.team_id = bst.id and bweh.project_id = bp.id and bweh.exit_time is null and bweh.exit_status = -1
|
||||||
AND bsr.is_active = '1'
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bweh.ID_NUMBER and bw.is_active = '1'
|
||||||
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bsr.`value`
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
AND btur.is_active = '1'
|
AND bw.worker_type = #{params.workerType}
|
||||||
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = btur.ID_NUMBER
|
</if>
|
||||||
AND bw.is_active = '1' and bw.worker_type = '1'
|
|
||||||
<where>
|
<where>
|
||||||
|
|
||||||
<if test="params.proId != null and params.proId != '' ">
|
<if test="params.proId != null and params.proId != '' ">
|
||||||
and bp.id = #{params.proId}
|
and bp.id = #{params.proId}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -273,47 +277,8 @@
|
||||||
limit #{offset},#{limit}
|
limit #{offset},#{limit}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 分包合同会移除班组 -->
|
|
||||||
<select id="getAttendanceByProList" resultType="com.bonus.bmw.person.entity.FaceContrastNewBean">
|
<!-- union
|
||||||
select * from (
|
|
||||||
SELECT
|
|
||||||
bp.id AS proId,
|
|
||||||
bp.NAME AS proName,
|
|
||||||
bs.id as subId,
|
|
||||||
bs.sub_name AS subName,
|
|
||||||
bst.id as teamId,
|
|
||||||
bst.`team_name` AS teamName,
|
|
||||||
COUNT( DISTINCT bw.id_number ) AS allPersonNum,
|
|
||||||
GROUP_CONCAT(bw.id_number) as allIdNumber,
|
|
||||||
GROUP_CONCAT(bw.name) as allName
|
|
||||||
FROM
|
|
||||||
bm_project bp
|
|
||||||
LEFT JOIN bm_sub_contract bsc ON bsc.pro_id = bp.id and bsc.is_active = '1'
|
|
||||||
LEFT JOIN bm_subcontractor bs on bs.id = bsc.sub_id and bs.is_active = '1'
|
|
||||||
<if test="params.subId != null and params.subId !='' ">
|
|
||||||
AND bs.id = #{params.subId}
|
|
||||||
</if>
|
|
||||||
LEFT JOIN bm_sub_relation bsr on bsr.sub_contract_id = bsc.id and bsr.type = '3'
|
|
||||||
<if test='params.notContractTeam == "" or params.notContractTeam == null'>
|
|
||||||
AND bsr.is_active = '1'
|
|
||||||
</if>
|
|
||||||
LEFT JOIN bm_sub_team bst ON bst.id = bsr.`value`
|
|
||||||
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bst.id and btur.is_active = '1'
|
|
||||||
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = btur.ID_NUMBER and bw.is_active = '1' and bw.worker_type = '1'
|
|
||||||
WHERE
|
|
||||||
bp.id = #{params.proId} and bst.id is not null
|
|
||||||
<if test="params.teamName != null and params.teamName != '' ">
|
|
||||||
and instr(bst.`team_name`,#{params.teamName}) > 0
|
|
||||||
</if>
|
|
||||||
<if test="params.subId != null and params.subId !='' ">
|
|
||||||
AND bs.id is not null
|
|
||||||
</if>
|
|
||||||
GROUP BY
|
|
||||||
bsr.`value`
|
|
||||||
ORDER BY
|
|
||||||
bsr.`value` ASC
|
|
||||||
) aa
|
|
||||||
union
|
|
||||||
SELECT
|
SELECT
|
||||||
bp.id AS proId,
|
bp.id AS proId,
|
||||||
bp.NAME AS proName,
|
bp.NAME AS proName,
|
||||||
|
|
@ -333,7 +298,45 @@
|
||||||
bp.id = #{params.proId}
|
bp.id = #{params.proId}
|
||||||
<if test="params.teamName != null and params.teamName != ''">
|
<if test="params.teamName != null and params.teamName != ''">
|
||||||
and instr('临时班组',#{params.teamName}) > 0
|
and instr('临时班组',#{params.teamName}) > 0
|
||||||
|
</if> -->
|
||||||
|
<select id="getAttendanceByProList" resultType="com.bonus.bmw.person.entity.FaceContrastNewBean">
|
||||||
|
select * from (
|
||||||
|
SELECT
|
||||||
|
bp.id AS proId,
|
||||||
|
bp.NAME AS proName,
|
||||||
|
bs.id as subId,
|
||||||
|
bs.sub_name AS subName,
|
||||||
|
bst.id as teamId,
|
||||||
|
bst.`team_name` AS teamName,
|
||||||
|
COUNT( DISTINCT bw.id_number ) AS allPersonNum,
|
||||||
|
GROUP_CONCAT(bw.id_number) as allIdNumber,
|
||||||
|
GROUP_CONCAT(bw.name) as allName
|
||||||
|
FROM
|
||||||
|
bm_project bp
|
||||||
|
LEFT JOIN bm_sub_contract bsc ON bsc.pro_id = bp.id and bsc.is_active = '1'
|
||||||
|
LEFT JOIN bm_subcontractor bs on bs.id = bsc.sub_id and bs.is_active = '1'
|
||||||
|
<if test="params.subId != null and params.subId !='' ">
|
||||||
|
AND bs.id = #{params.subId}
|
||||||
</if>
|
</if>
|
||||||
|
LEFT JOIN bm_sub_team bst on bs.id = bst.sub_id and bs.is_active = '1'
|
||||||
|
Left Join bm_worker_ein_history bweh on bweh.team_id = bst.id and bweh.project_id = bp.id and bweh.exit_time is null and bweh.exit_status = -1
|
||||||
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bweh.ID_NUMBER and bw.is_active = '1'
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND bw.worker_type = #{params.workerType}
|
||||||
|
</if>
|
||||||
|
WHERE
|
||||||
|
bp.id = #{params.proId} and bst.id is not null
|
||||||
|
<if test="params.teamName != null and params.teamName != '' ">
|
||||||
|
and instr(bst.`team_name`,#{params.teamName}) > 0
|
||||||
|
</if>
|
||||||
|
<if test="params.subId != null and params.subId !='' ">
|
||||||
|
AND bs.id is not null
|
||||||
|
</if>
|
||||||
|
GROUP BY
|
||||||
|
bst.`id`
|
||||||
|
ORDER BY
|
||||||
|
bst.`id`
|
||||||
|
) aa
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<select id="getTeamSevenNoAttPersonNum" resultType="com.bonus.bmw.person.entity.MapBean">
|
<select id="getTeamSevenNoAttPersonNum" resultType="com.bonus.bmw.person.entity.MapBean">
|
||||||
|
|
@ -446,7 +449,11 @@
|
||||||
ffc.CURRENT_DAY AS currentDay,
|
ffc.CURRENT_DAY AS currentDay,
|
||||||
ffc.attendance_type AS attendanceType
|
ffc.attendance_type AS attendanceType
|
||||||
FROM
|
FROM
|
||||||
(select `name`,`ID_NUMBER`,post_id FROM bm_worker WHERE ID_NUMBER = #{obj.idNumber} AND is_active = '1' )bw
|
(select `name`,`ID_NUMBER`,post_id FROM bm_worker WHERE ID_NUMBER = #{obj.idNumber} AND is_active = '1'
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND worker_type = #{params.workerType}
|
||||||
|
</if>
|
||||||
|
)bw
|
||||||
LEFT JOIN t_dict sdd ON sdd.id = bw.POST_ID
|
LEFT JOIN t_dict sdd ON sdd.id = bw.POST_ID
|
||||||
AND sdd.is_active = '1'
|
AND sdd.is_active = '1'
|
||||||
LEFT JOIN fc_face_contrast ffc ON ffc.ID_NUMBER = bw.ID_NUMBER
|
LEFT JOIN fc_face_contrast ffc ON ffc.ID_NUMBER = bw.ID_NUMBER
|
||||||
|
|
@ -575,7 +582,10 @@
|
||||||
</if>
|
</if>
|
||||||
GROUP BY id_number)bweh ON bweh.project_id = bp.id
|
GROUP BY id_number)bweh ON bweh.project_id = bp.id
|
||||||
LEFT JOIN ( SELECT fc.id_number, fc.pro_id FROM fc_face_contrast fc
|
LEFT JOIN ( SELECT fc.id_number, fc.pro_id FROM fc_face_contrast fc
|
||||||
LEFT JOIN bm_worker bw on bw.id_number = fc.ID_NUMBER and bw.worker_type = '1'
|
LEFT JOIN bm_worker bw on bw.id_number = fc.ID_NUMBER
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND bw.worker_type = #{params.workerType}
|
||||||
|
</if>
|
||||||
WHERE fc.CURRENT_DAY = #{params.startTime}
|
WHERE fc.CURRENT_DAY = #{params.startTime}
|
||||||
<if test="params.proId != null and params.proId != '' ">
|
<if test="params.proId != null and params.proId != '' ">
|
||||||
and fc.pro_id = #{params.proId}
|
and fc.pro_id = #{params.proId}
|
||||||
|
|
@ -595,7 +605,21 @@
|
||||||
bp.id ASC
|
bp.id ASC
|
||||||
limit #{offset},#{limit}
|
limit #{offset},#{limit}
|
||||||
</select>
|
</select>
|
||||||
<!-- 分包合同会移除班组 -->
|
<!-- union all
|
||||||
|
SELECT
|
||||||
|
count(DISTINCT ffc.id_number )
|
||||||
|
FROM
|
||||||
|
bm_project bp
|
||||||
|
LEFT JOIN (select id_number,project_id FROM bm_worker_ein_history WHERE (sub_id is null or sub_id = 0)and is_active = '1' AND is_furlough_person = '0' AND exit_status != '1' GROUP BY id_number)bweh ON bweh.project_id = bp.id
|
||||||
|
LEFT JOIN ( SELECT id_number, pro_id FROM fc_face_contrast WHERE CURRENT_DAY = #{params.startTime} GROUP BY id_number, CURRENT_DAY ) ffc ON ffc.id_number = bweh.id_number
|
||||||
|
WHERE
|
||||||
|
bp.id = #{params.proId}
|
||||||
|
<if test="params.teamName != null and params.teamName != '' ">
|
||||||
|
and instr('临时班组',#{params.teamName}) > 0
|
||||||
|
</if> -->
|
||||||
|
<!-- <if test='params.notContractTeam == "" or params.notContractTeam == null'>-->
|
||||||
|
<!-- AND bsr.is_active = '1'-->
|
||||||
|
<!-- </if>-->
|
||||||
<select id="getWorkAttListByPro" resultType="java.lang.Integer">
|
<select id="getWorkAttListByPro" resultType="java.lang.Integer">
|
||||||
select * from (
|
select * from (
|
||||||
SELECT
|
SELECT
|
||||||
|
|
@ -607,38 +631,23 @@
|
||||||
AND bsc.sub_id = #{params.subId}
|
AND bsc.sub_id = #{params.subId}
|
||||||
</if>
|
</if>
|
||||||
AND bsc.is_active = '1'
|
AND bsc.is_active = '1'
|
||||||
LEFT JOIN bm_sub_relation bsr ON bsr.type = '3'
|
LEFT JOIN bm_sub_team bst on bsc.sub_id = bst.sub_id and bst.is_active = '1'
|
||||||
<if test='params.notContractTeam == "" or params.notContractTeam == null'>
|
Left Join bm_worker_ein_history bweh on bweh.team_id = bst.id and bweh.project_id = bp.id and bweh.exit_time is null and bweh.exit_status = -1
|
||||||
AND bsr.is_active = '1'
|
LEFT JOIN bm_worker bw ON bw.ID_NUMBER = bweh.ID_NUMBER and bw.is_active = '1'
|
||||||
|
<if test="params.workerType != null and params.workerType !='' ">
|
||||||
|
AND bw.worker_type = #{params.workerType}
|
||||||
</if>
|
</if>
|
||||||
AND bsr.sub_contract_id = bsc.id
|
LEFT JOIN ( SELECT id_number, pro_id FROM fc_face_contrast WHERE CURRENT_DAY = #{params.startTime} GROUP BY id_number, CURRENT_DAY ) ffc ON ffc.id_number = bw.ID_NUMBER
|
||||||
LEFT JOIN bm_team_user_relation btur ON btur.team_id = bsr.`value`
|
|
||||||
AND btur.is_active = '1'
|
|
||||||
LEFT JOIN bm_sub_team bst ON bst.id = bsr.`value`
|
|
||||||
LEFT JOIN ( SELECT id_number, pro_id FROM fc_face_contrast WHERE CURRENT_DAY = #{params.startTime} GROUP BY id_number, CURRENT_DAY ) ffc ON ffc.id_number = btur.id_number
|
|
||||||
WHERE
|
WHERE
|
||||||
bp.id = #{params.proId} and bst.id is not null
|
bp.id = #{params.proId} and bst.id is not null
|
||||||
<if test="params.teamName != null and params.teamName != '' ">
|
<if test="params.teamName != null and params.teamName != '' ">
|
||||||
and instr(bst.`team_name`,#{params.teamName}) > 0
|
and instr(bst.`team_name`,#{params.teamName}) > 0
|
||||||
</if>
|
</if>
|
||||||
GROUP BY
|
GROUP BY
|
||||||
bsr.`value`
|
bst.id
|
||||||
ORDER BY
|
ORDER BY
|
||||||
bsr.`value` ASC
|
bst.id
|
||||||
) aa
|
) aa
|
||||||
union all
|
|
||||||
SELECT
|
|
||||||
count(DISTINCT ffc.id_number )
|
|
||||||
FROM
|
|
||||||
bm_project bp
|
|
||||||
LEFT JOIN (select id_number,project_id FROM bm_worker_ein_history WHERE (sub_id is null or sub_id = 0)and is_active = '1' AND is_furlough_person = '0' AND exit_status != '1' GROUP BY id_number)bweh ON bweh.project_id = bp.id
|
|
||||||
LEFT JOIN ( SELECT id_number, pro_id FROM fc_face_contrast WHERE CURRENT_DAY = #{params.startTime} GROUP BY id_number, CURRENT_DAY ) ffc ON ffc.id_number = bweh.id_number
|
|
||||||
WHERE
|
|
||||||
bp.id = #{params.proId}
|
|
||||||
<if test="params.teamName != null and params.teamName != '' ">
|
|
||||||
and instr('临时班组',#{params.teamName}) > 0
|
|
||||||
</if>
|
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
<select id="getTrueEinDate" resultType="com.bonus.bmw.person.entity.AttDateBean">
|
<select id="getTrueEinDate" resultType="com.bonus.bmw.person.entity.AttDateBean">
|
||||||
select
|
select
|
||||||
|
|
@ -811,4 +820,4 @@
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -214,18 +214,18 @@ function init() {
|
||||||
},width: '25%'},
|
},width: '25%'},
|
||||||
{"data": "allPersonNum",width: '10%'},
|
{"data": "allPersonNum",width: '10%'},
|
||||||
{"data": "attPersonNum",width: '10%'},
|
{"data": "attPersonNum",width: '10%'},
|
||||||
{"data": "","defaultContent": "",
|
// {"data": "","defaultContent": "",
|
||||||
"orderable": false,
|
// "orderable": false,
|
||||||
"render": function (data, type, row) {
|
// "render": function (data, type, row) {
|
||||||
var sevenNoAttPersonNum = row['sevenNoAttPersonNum'];
|
// var sevenNoAttPersonNum = row['sevenNoAttPersonNum'];
|
||||||
var teamId = row['teamId'];
|
// var teamId = row['teamId'];
|
||||||
var teamName = row['teamName'];
|
// var teamName = row['teamName'];
|
||||||
var proId = row['proId'];
|
// var proId = row['proId'];
|
||||||
var proName = row['proName'];
|
// var proName = row['proName'];
|
||||||
var html = '';
|
// var html = '';
|
||||||
html += "<a style = 'color:#09A8F1;cursor: pointer' onclick = 'getAttendanceBySeven(\"" + teamId + "\",\"" + teamName + "\",\"" + proId + "\",\"" + proName + "\")'>" + sevenNoAttPersonNum + "</a>";
|
// html += "<a style = 'color:#09A8F1;cursor: pointer' onclick = 'getAttendanceBySeven(\"" + teamId + "\",\"" + teamName + "\",\"" + proId + "\",\"" + proName + "\")'>" + sevenNoAttPersonNum + "</a>";
|
||||||
return html;
|
// return html;
|
||||||
},width: '10%'},
|
// },width: '10%'},
|
||||||
],
|
],
|
||||||
// "order": [[0, "desc"], [1, "asc"]] //在栏目列上显示排序功能
|
// "order": [[0, "desc"], [1, "asc"]] //在栏目列上显示排序功能
|
||||||
});
|
});
|
||||||
|
|
@ -401,4 +401,4 @@ function explainClick(str) {
|
||||||
shadeClose: true, // 点击遮罩关闭层
|
shadeClose: true, // 点击遮罩关闭层
|
||||||
maxmin: false
|
maxmin: false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
<th>班组名称</th>
|
<th>班组名称</th>
|
||||||
<th>总人数</th>
|
<th>总人数</th>
|
||||||
<th>考勤人数</th>
|
<th>考勤人数</th>
|
||||||
<th>连续七天未打卡</th>
|
<!-- <th>连续七天未打卡</th>-->
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
|
@ -101,4 +101,4 @@
|
||||||
<script type="text/javascript" src="../../../../js/select.js"></script>
|
<script type="text/javascript" src="../../../../js/select.js"></script>
|
||||||
<script type="text/javascript" src="../../../../js/work/Person/AttendanceManageNew/AttendanceByProList.js" defer="defer"></script>
|
<script type="text/javascript" src="../../../../js/work/Person/AttendanceManageNew/AttendanceByProList.js" defer="defer"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue