修改bug
This commit is contained in:
parent
16facda583
commit
dec4de7dd4
@ -21,10 +21,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.*;
|
||||
|
||||
|
||||
/**
|
||||
@ -589,4 +586,16 @@ public class WorkerInfoController {
|
||||
public Result<PresenceAndTotalNumberOfEngineeringPersonnelVo> queryThePresenceAndTotalNumberOfEngineeringPersonnel() {
|
||||
return Result.success(workerInfoService.queryThePresenceAndTotalNumberOfEngineeringPersonnel());
|
||||
}
|
||||
|
||||
/**
|
||||
* 统计特殊工种人员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/getSpecialWorkerStatics")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
public Result<SpecialWorkerStaticsVo> getSpecialWorkerStatics(@RequestParam HashMap<String, Object> map) {
|
||||
return Result.success(workerInfoService.getSpecialWorkerStatics(map));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
package com.zhgd.xmgl.modules.worker.entity.vo;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class SpecialWorkerStaticsVo {
|
||||
@ApiModelProperty(value = "总人数")
|
||||
private Integer totalNum;
|
||||
@ApiModelProperty(value = "在场人数")
|
||||
private Integer inService;
|
||||
}
|
||||
@ -10,6 +10,7 @@ import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -227,4 +228,6 @@ public interface WorkerInfoMapper extends BaseMapper<WorkerInfo> {
|
||||
List<PresenceAndTotalNumberOfEngineeringPersonnelVo.Count> queryTotalNum();
|
||||
|
||||
List<TypeNumVo> countWorkerNumGroupByWorkerType(Map<String, Object> map);
|
||||
|
||||
SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@ -37,16 +37,16 @@
|
||||
LEFT JOIN enterprise_info en ON en.id = a.enterprise_id
|
||||
WHERE 1 = 1
|
||||
<if test="param.chargePersonName != null and param.chargePersonName != ''">
|
||||
and c.charge_person_name like CONCAT(CONCAT('%',#{param.chargePersonName}),'%')
|
||||
and c.charge_person_name like CONCAT(CONCAT('%', #{param.chargePersonName}), '%')
|
||||
</if>
|
||||
<if test="param.leaderName != null and param.leaderName != ''">
|
||||
and b.leader_name like CONCAT(CONCAT('%',#{param.leaderName}),'%')
|
||||
and b.leader_name like CONCAT(CONCAT('%', #{param.leaderName}), '%')
|
||||
</if>
|
||||
<if test="param.belongingSection != null and param.belongingSection != ''">
|
||||
and c.belonging_section like CONCAT(CONCAT('%',#{param.belongingSection}),'%')
|
||||
and c.belonging_section like CONCAT(CONCAT('%', #{param.belongingSection}), '%')
|
||||
</if>
|
||||
<if test="param.belongingSection != null and param.belongingSection != ''">
|
||||
and c.belonging_section like CONCAT(CONCAT('%',#{param.belongingSection}),'%')
|
||||
and c.belonging_section like CONCAT(CONCAT('%', #{param.belongingSection}), '%')
|
||||
</if>
|
||||
<if test="param.projectSn != null and param.projectSn != ''">
|
||||
and a.project_sn = #{param.projectSn}
|
||||
@ -172,26 +172,30 @@
|
||||
<select id="selectWorkerInfoByPersonSn" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where person_sn = #{personSn} LIMIT 1
|
||||
where person_sn = #{personSn}
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectWorkWorkerInfoWithIDCard" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and id_card = #{idCard}
|
||||
and inService_type = 1 LIMIT 1
|
||||
and id_card = #{idCard}
|
||||
and inService_type = 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="selectWorkWorkerInfoWithAttendanceNumber" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and attendance_number = #{attendanceNumber}
|
||||
and inService_type = 1 LIMIT 1
|
||||
and attendance_number = #{attendanceNumber}
|
||||
and inService_type = 1
|
||||
LIMIT 1
|
||||
</select>
|
||||
<select id="getNotifyPersonList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
select *
|
||||
from worker_info
|
||||
where FIND_IN_SET(id, #{notifyPerson}) LIMIT 1
|
||||
where FIND_IN_SET(id, #{notifyPerson})
|
||||
LIMIT 1
|
||||
</select>
|
||||
|
||||
<select id="getProjectWorkerStatistics" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
@ -535,7 +539,7 @@
|
||||
INNER JOIN company b ON cp.parent_id = b.company_id
|
||||
INNER JOIN enterprise_info p ON p.id = w1.enterprise_id
|
||||
Left JOIN company f ON b.parent_id = f.company_id
|
||||
INNER JOIN project_enterprise pe ON pe.enterprise_id = p.id and a.project_sn=pe.project_sn
|
||||
INNER JOIN project_enterprise pe ON pe.enterprise_id = p.id and a.project_sn = pe.project_sn
|
||||
WHERE w1.inService_type = 1
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and a.project_name like CONCAT(CONCAT('%', #{projectName}), '%')
|
||||
@ -809,17 +813,17 @@
|
||||
<select id="selectProjectTeamWorkTotalList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap"
|
||||
parameterType="map">
|
||||
SELECT e.team_name,
|
||||
IFNULL(tp2.total_person_num, 0) total_person_num,
|
||||
IFNULL(tp.person_num, 0) attendance_person_num
|
||||
IFNULL(tp2.total_person_num, 0) total_person_num,
|
||||
IFNULL(tp.person_num, 0) attendance_person_num
|
||||
FROM team_info e
|
||||
LEFT JOIN (SELECT w1.team_id, COUNT(DISTINCT w1.person_sn) person_num
|
||||
from worker_info w1
|
||||
INNER JOIN worker_attendance p ON w1.person_sn = p.person_sn
|
||||
WHERE p.create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
|
||||
and w1.inService_type = 1
|
||||
AND w1.person_type = 1
|
||||
and w1.project_sn = #{projectSn}
|
||||
group by w1.team_id
|
||||
LEFT JOIN (SELECT w1.team_id, COUNT(DISTINCT w1.person_sn) person_num
|
||||
from worker_info w1
|
||||
INNER JOIN worker_attendance p ON w1.person_sn = p.person_sn
|
||||
WHERE p.create_time >= CONCAT(DATE_FORMAT(now(), "%Y-%m-%d"), ' 00:00:00')
|
||||
and w1.inService_type = 1
|
||||
AND w1.person_type = 1
|
||||
and w1.project_sn = #{projectSn}
|
||||
group by w1.team_id
|
||||
) tp ON e.id = tp.team_id
|
||||
LEFT JOIN (SELECT w1.team_id, COUNT(DISTINCT w1.person_sn) total_person_num
|
||||
FROM worker_info w1
|
||||
@ -873,32 +877,32 @@
|
||||
</select>
|
||||
<select id="selectWorkerInfoById" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,
|
||||
b.enterprise_name,
|
||||
b.enterprise_legal_person,
|
||||
b.legal_person_id_card,
|
||||
b.legal_person_tel,
|
||||
b.social_code,
|
||||
b.enterprise_email,
|
||||
b.registered_capital,
|
||||
b.register_person_name,
|
||||
b.register_person_phone_tel,
|
||||
b.enterprise_sn,
|
||||
e.enterprise_type_id,
|
||||
f.company_type_name,
|
||||
c.leader_id_card team_leader_id_card,
|
||||
c.leader_name team_leader_name,
|
||||
c.team_name,
|
||||
c.team_sn,
|
||||
c.leader_phone team_leader_phone,
|
||||
p.project_name,
|
||||
d.type_name
|
||||
b.enterprise_name,
|
||||
b.enterprise_legal_person,
|
||||
b.legal_person_id_card,
|
||||
b.legal_person_tel,
|
||||
b.social_code,
|
||||
b.enterprise_email,
|
||||
b.registered_capital,
|
||||
b.register_person_name,
|
||||
b.register_person_phone_tel,
|
||||
b.enterprise_sn,
|
||||
e.enterprise_type_id,
|
||||
f.company_type_name,
|
||||
c.leader_id_card team_leader_id_card,
|
||||
c.leader_name team_leader_name,
|
||||
c.team_name,
|
||||
c.team_sn,
|
||||
c.leader_phone team_leader_phone,
|
||||
p.project_name,
|
||||
d.type_name
|
||||
FROM worker_info a
|
||||
INNER JOIN enterprise_info b ON a.enterprise_id = b.id
|
||||
INNER JOIN team_info c ON a.team_id = c.id
|
||||
INNER JOIN project p ON a.project_sn = p.project_sn
|
||||
LEFT JOIN worker_type d ON c.worker_type_id = d.id
|
||||
LEFT JOIN project_enterprise e ON (a.project_sn = e.project_sn and a.enterprise_id = e.enterprise_id)
|
||||
LEFT JOIN enterprise_type f ON e.enterprise_type_id = f.id
|
||||
INNER JOIN enterprise_info b ON a.enterprise_id = b.id
|
||||
INNER JOIN team_info c ON a.team_id = c.id
|
||||
INNER JOIN project p ON a.project_sn = p.project_sn
|
||||
LEFT JOIN worker_type d ON c.worker_type_id = d.id
|
||||
LEFT JOIN project_enterprise e ON (a.project_sn = e.project_sn and a.enterprise_id = e.enterprise_id)
|
||||
LEFT JOIN enterprise_type f ON e.enterprise_type_id = f.id
|
||||
where a.id = #{id}
|
||||
</select>
|
||||
<select id="selectAttendanceWorkerPersonTypeTotal" resultType="java.util.Map">
|
||||
@ -982,12 +986,12 @@
|
||||
</select>
|
||||
<select id="viewWorkerInfoDetail" resultType="com.zhgd.jeecg.common.mybatis.EntityMap" parameterType="map">
|
||||
SELECT a.*,
|
||||
b.team_name,
|
||||
c.department_name,
|
||||
en.enterprise_name,
|
||||
p.project_name,
|
||||
(case
|
||||
when a.birthday != '' then year (from_days(datediff(NOW(), a.birthday))) else '-'
|
||||
b.team_name,
|
||||
c.department_name,
|
||||
en.enterprise_name,
|
||||
p.project_name,
|
||||
(case
|
||||
when a.birthday != '' then year (from_days(datediff(NOW(), a.birthday))) else '-'
|
||||
end
|
||||
) age,
|
||||
d.dictionary_name job_type_name,
|
||||
@ -1009,13 +1013,13 @@
|
||||
</select>
|
||||
<select id="selectWorkExperienceList" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,
|
||||
b.team_name,
|
||||
c.department_name,
|
||||
en.enterprise_name,
|
||||
p.project_name,
|
||||
t.type_name,
|
||||
(case
|
||||
when a.birthday != '' then year (from_days(datediff(NOW(), a.birthday))) else '-'
|
||||
b.team_name,
|
||||
c.department_name,
|
||||
en.enterprise_name,
|
||||
p.project_name,
|
||||
t.type_name,
|
||||
(case
|
||||
when a.birthday != '' then year (from_days(datediff(NOW(), a.birthday))) else '-'
|
||||
end
|
||||
) age,
|
||||
d.dictionary_name job_type_name,
|
||||
@ -1038,37 +1042,37 @@
|
||||
desc
|
||||
</select>
|
||||
<select id="selectProjectLabourWorkerCount" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT COUNT(1) total_person,
|
||||
COUNT(distinct w1.team_id) total_team_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 then 1 ELSE 0 END)), 0) lw_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 then 1 ELSE 0 END)), 0) gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 3 then 1 ELSE 0 END)), 0) ls_person_total,
|
||||
IFNULL(AVG(IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0)), 0) avgage,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 18 then 1 ELSE 0 END)),
|
||||
0) age18,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 18 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 25 then 1
|
||||
ELSE 0 END)), 0) age18To25,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 25 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 35 then 1
|
||||
ELSE 0 END)), 0) age25To35,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 35 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 45 then 1
|
||||
ELSE 0 END)), 0) age35To45,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 45 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 60 then 1
|
||||
ELSE 0 END)), 0) age45To60,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 60 then 1 ELSE 0 END)),
|
||||
0) age60
|
||||
SELECT COUNT(1) total_person,
|
||||
COUNT(distinct w1.team_id) total_team_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 then 1 ELSE 0 END)), 0) lw_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 then 1 ELSE 0 END)), 0) gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 3 then 1 ELSE 0 END)), 0) ls_person_total,
|
||||
IFNULL(AVG(IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0)), 0) avgage,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 18 then 1 ELSE 0 END)),
|
||||
0) age18,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 18 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 25 then 1
|
||||
ELSE 0 END)), 0) age18To25,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 25 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 35 then 1
|
||||
ELSE 0 END)), 0) age25To35,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 35 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 45 then 1
|
||||
ELSE 0 END)), 0) age35To45,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 45 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 60 then 1
|
||||
ELSE 0 END)), 0) age45To60,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 60 then 1 ELSE 0 END)),
|
||||
0) age60
|
||||
from worker_info w1
|
||||
INNER JOIN project a ON w1.project_sn = a.project_sn
|
||||
INNER JOIN project a ON w1.project_sn = a.project_sn
|
||||
WHERE w1.inService_type = 1
|
||||
and w1.person_type = 1
|
||||
and w1.project_sn = #{projectSn}
|
||||
and w1.person_type = 1
|
||||
and w1.project_sn = #{projectSn}
|
||||
</select>
|
||||
<select id="selectAttendanceWorkerListByDate" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT a.*,
|
||||
@ -1190,27 +1194,27 @@
|
||||
</select>
|
||||
<select id="getProjectWorkerImageList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select a.id,
|
||||
a.worker_name,
|
||||
a.id_card,
|
||||
a.attendance_number,
|
||||
a.project_sn,
|
||||
a.person_sn,
|
||||
a.person_type,
|
||||
a.person_serial,
|
||||
a.field_acquisition_url,
|
||||
b.feahongruan
|
||||
a.worker_name,
|
||||
a.id_card,
|
||||
a.attendance_number,
|
||||
a.project_sn,
|
||||
a.person_sn,
|
||||
a.person_type,
|
||||
a.person_serial,
|
||||
a.field_acquisition_url,
|
||||
b.feahongruan
|
||||
from worker_info a
|
||||
INNER JOIN worker_photo_features b ON a.person_sn = b.person_sn
|
||||
INNER JOIN worker_photo_features b ON a.person_sn = b.person_sn
|
||||
where a.project_sn = #{projectSn}
|
||||
and (a.person_serial is null or a.person_serial = '')
|
||||
and a.inService_type = 1
|
||||
and (a.person_serial is null or a.person_serial = '')
|
||||
and a.inService_type = 1
|
||||
</select>
|
||||
<select id="selectWorkWorkerInfoWithPersonSerial" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and person_serial = #{personSerial}
|
||||
and inService_type = 1 LIMIT 1
|
||||
and person_serial = #{personSerial}
|
||||
and inService_type = 1 LIMIT 1
|
||||
</select>
|
||||
<select id="selectCompanyPersonTypeTotal" resultType="java.util.Map">
|
||||
select COUNT(1) totalPerson,
|
||||
@ -1286,15 +1290,15 @@
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and inService_type = 1
|
||||
and person_type = #{personType}
|
||||
and is_upload_housing = 1
|
||||
and inService_type = 1
|
||||
and person_type = #{personType}
|
||||
and is_upload_housing = 1
|
||||
</select>
|
||||
<select id="selectAllWorkerInfoList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where project_sn = #{projectSn}
|
||||
and inService_type = 1
|
||||
and inService_type = 1
|
||||
</select>
|
||||
<select id="selectProjectWorkerInfoList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo"
|
||||
parameterType="map">
|
||||
@ -1313,27 +1317,27 @@
|
||||
select GROUP_CONCAT(worker_name)
|
||||
from worker_info
|
||||
where inService_type = 1
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
</select>
|
||||
<select id="selectCarDriverNameList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select *
|
||||
from worker_info
|
||||
where inService_type = 1
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
</select>
|
||||
<select id="selectUserWorkerList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select a.*
|
||||
from worker_info a
|
||||
INNER JOIN system_user b ON a.id = b.worker_id
|
||||
INNER JOIN system_user b ON a.id = b.worker_id
|
||||
where inService_type = 1
|
||||
AND FIND_IN_SET(b.user_id, #{userIds})
|
||||
AND FIND_IN_SET(b.user_id, #{userIds})
|
||||
</select>
|
||||
<select id="selectCarDriverNameData" resultType="java.util.Map">
|
||||
select a.worker_name workerName, en.enterprise_name enterpriseName
|
||||
from worker_info a
|
||||
LEFT JOIN enterprise_info en ON en.id = a.enterprise_id
|
||||
LEFT JOIN enterprise_info en ON en.id = a.enterprise_id
|
||||
where a.inService_type = 1
|
||||
and FIND_IN_SET(a.id, #{driverWorkerId})
|
||||
and FIND_IN_SET(a.id, #{driverWorkerId})
|
||||
</select>
|
||||
<select id="selectAreaWorkAttendanceCountList" resultType="java.util.Map" parameterType="java.util.Map">
|
||||
<!--
|
||||
@ -1881,8 +1885,8 @@
|
||||
select count(1)
|
||||
from worker_info
|
||||
where inService_type = 1
|
||||
and code_state in (1, 2)
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
and code_state in (1, 2)
|
||||
and FIND_IN_SET(id, #{driverWorkerId})
|
||||
</select>
|
||||
<select id="selectProjectWorkerPageList" resultType="java.util.Map">
|
||||
SELECT a.id_card idCard,
|
||||
@ -2087,95 +2091,95 @@
|
||||
</select>
|
||||
|
||||
<select id="selectProjectWorkerTotalCount" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
SELECT COUNT(1) total_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 then 1 ELSE 0 END)), 0) labour_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 then 1 ELSE 0 END)), 0) manage_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 3 then 1 ELSE 0 END)), 0) ls_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 or w1.person_type = 2 then 1 ELSE 0 END)),
|
||||
0) lw_and_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 1 then 1 ELSE 0 END)), 0) jf_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 2 then 1 ELSE 0 END)), 0) jl_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 3 then 1 ELSE 0 END)), 0) yf_gl_person_total,
|
||||
IFNULL(sum((CASE
|
||||
WHEN w1.person_type = 1 and DATE_FORMAT(w1.add_time, "%Y-%m-%d") =
|
||||
DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d")
|
||||
then 1
|
||||
ELSE 0 END)), 0) lw_person_yesterday_add,
|
||||
IFNULL(sum((CASE
|
||||
WHEN w1.person_type = 2 and DATE_FORMAT(w1.add_time, "%Y-%m-%d") =
|
||||
DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d")
|
||||
then 1
|
||||
ELSE 0 END)), 0) gl_person_yesterday_add,
|
||||
IFNULL(sum((CASE WHEN w1.sex = 1 and (w1.person_type = 1 or w1.person_type = 2) then 1 ELSE 0 END)),
|
||||
0) man_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.sex = 2 and (w1.person_type = 1 or w1.person_type = 2) then 1 ELSE 0 END)),
|
||||
0) woman_person_total,
|
||||
IFNULL(sum((CASE WHEN g.special_team = 1 then 1 ELSE 0 END)), 0) special_person_total,
|
||||
IFNULL(sum((CASE WHEN ba.id is not null then 1 ELSE 0 END)), 0) blacklist_person_total,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(w1.special_certificate_number, '') != '' or
|
||||
IFNULL(w1.employment_card, '') != '' then 1
|
||||
SELECT COUNT(1) total_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 then 1 ELSE 0 END)), 0) labour_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 then 1 ELSE 0 END)), 0) manage_worker_num,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 3 then 1 ELSE 0 END)), 0) ls_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 1 or w1.person_type = 2 then 1 ELSE 0 END)),
|
||||
0) lw_and_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 1 then 1 ELSE 0 END)), 0) jf_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 2 then 1 ELSE 0 END)), 0) jl_gl_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.person_type = 2 and w2.type = 3 then 1 ELSE 0 END)), 0) yf_gl_person_total,
|
||||
IFNULL(sum((CASE
|
||||
WHEN w1.person_type = 1 and DATE_FORMAT(w1.add_time, "%Y-%m-%d") =
|
||||
DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d")
|
||||
then 1
|
||||
ELSE 0 END)), 0) lw_person_yesterday_add,
|
||||
IFNULL(sum((CASE
|
||||
WHEN w1.person_type = 2 and DATE_FORMAT(w1.add_time, "%Y-%m-%d") =
|
||||
DATE_FORMAT(DATE_ADD(NOW(), INTERVAL -1 DAY), "%Y-%m-%d")
|
||||
then 1
|
||||
ELSE 0 END)), 0) gl_person_yesterday_add,
|
||||
IFNULL(sum((CASE WHEN w1.sex = 1 and (w1.person_type = 1 or w1.person_type = 2) then 1 ELSE 0 END)),
|
||||
0) man_person_total,
|
||||
IFNULL(sum((CASE WHEN w1.sex = 2 and (w1.person_type = 1 or w1.person_type = 2) then 1 ELSE 0 END)),
|
||||
0) woman_person_total,
|
||||
IFNULL(sum((CASE WHEN g.special_team = 1 then 1 ELSE 0 END)), 0) special_person_total,
|
||||
IFNULL(sum((CASE WHEN ba.id is not null then 1 ELSE 0 END)), 0) blacklist_person_total,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(w1.special_certificate_number, '') != '' or
|
||||
IFNULL(w1.employment_card, '') != '' then 1
|
||||
ELSE 0 END)),
|
||||
0) certificate_person_total,
|
||||
IFNULL(AVG(IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0)), 0) avgage,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 18 then 1 ELSE 0 END)),
|
||||
0) age18,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 18 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 25 then 1
|
||||
ELSE 0 END)), 0) age18to25,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 25 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 35 then 1
|
||||
ELSE 0 END)), 0) age25to35,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 35 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 45 then 1
|
||||
ELSE 0 END)), 0) age35to45,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 45 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 60 then 1
|
||||
ELSE 0 END)), 0) age45to60,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 60 then 1 ELSE 0 END)),
|
||||
0) age60
|
||||
0) certificate_person_total,
|
||||
IFNULL(AVG(IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0)), 0) avgage,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 18 then 1 ELSE 0 END)),
|
||||
0) age18,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 18 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 25 then 1
|
||||
ELSE 0 END)), 0) age18to25,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 25 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 35 then 1
|
||||
ELSE 0 END)), 0) age25to35,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 35 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 45 then 1
|
||||
ELSE 0 END)), 0) age35to45,
|
||||
IFNULL(sum((CASE
|
||||
WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 45 and
|
||||
IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) < 60 then 1
|
||||
ELSE 0 END)), 0) age45to60,
|
||||
IFNULL(sum((CASE WHEN IFNULL(TIMESTAMPDIFF(YEAR, w1.birthday, CURDATE()), 0) >= 60 then 1 ELSE 0 END)),
|
||||
0) age60
|
||||
from worker_info w1
|
||||
INNER JOIN project a ON w1.project_sn = a.project_sn
|
||||
LEFT JOIN dictionaries_record w2 ON w1.job_type = w2.id
|
||||
LEFT JOIN dictionaries_record w3 ON w1.job_name = w3.id
|
||||
Left JOIN team_info g ON w1.team_id = g.id
|
||||
Left JOIN worker_blacklist ba ON w1.id = ba.worker_id
|
||||
INNER JOIN project a ON w1.project_sn = a.project_sn
|
||||
LEFT JOIN dictionaries_record w2 ON w1.job_type = w2.id
|
||||
LEFT JOIN dictionaries_record w3 ON w1.job_name = w3.id
|
||||
Left JOIN team_info g ON w1.team_id = g.id
|
||||
Left JOIN worker_blacklist ba ON w1.id = ba.worker_id
|
||||
where w1.inService_type = 1
|
||||
and w1.project_sn = #{projectSn}
|
||||
and w1.project_sn = #{projectSn}
|
||||
</select>
|
||||
<select id="selectWorkerAntiepidemicTotal" resultType="java.util.Map" parameterType="java.util.Map">
|
||||
SELECT count(1) totalWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.person_type = 1 THEN 1 ELSE 0 END)), 0) labourWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.person_type = 2 THEN 1 ELSE 0 END)), 0) manageWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 0 THEN 1 ELSE 0 END)), 0) noCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 1 THEN 1 ELSE 0 END)), 0) redCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 2 THEN 1 ELSE 0 END)), 0) yellowCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 3 THEN 1 ELSE 0 END)), 0) greenCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 0 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum0,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 1 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum1,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 2 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum2,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 3 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum3,
|
||||
IFNULL(sum((CASE WHEN a.nad_time is null or a.nad_time = '' THEN 1 ELSE 0 END)), 0) noAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMPIFF(HOUR, a.nad_time, now()) >= 72 and a.worker_classify = 3 THEN 1
|
||||
ELSE 0 END)), 0) otherAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMDIFF(HOUR, a.nad_time, now()) >= 168 and a.worker_classify = 1 THEN 1
|
||||
ELSE 0 END)), 0) ordinaryAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMPDPDIFF(HOUR, a.nad_time, now()) >= 72 and a.worker_classify = 3 THEN 1
|
||||
ELSE 0 END)), 0) outsideAcidNum
|
||||
SELECT count(1) totalWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.person_type = 1 THEN 1 ELSE 0 END)), 0) labourWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.person_type = 2 THEN 1 ELSE 0 END)), 0) manageWorkerNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 0 THEN 1 ELSE 0 END)), 0) noCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 1 THEN 1 ELSE 0 END)), 0) redCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 2 THEN 1 ELSE 0 END)), 0) yellowCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN a.code_state = 3 THEN 1 ELSE 0 END)), 0) greenCodeStateNum,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 0 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum0,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 1 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum1,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 2 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum2,
|
||||
IFNULL(sum((CASE WHEN IFNULL(a.vaccine_status, 0) = 3 THEN 1 ELSE 0 END)),
|
||||
0) vaccineInoculationNum3,
|
||||
IFNULL(sum((CASE WHEN a.nad_time is null or a.nad_time = '' THEN 1 ELSE 0 END)), 0) noAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMPIFF(HOUR, a.nad_time, now()) >= 72 and a.worker_classify = 3 THEN 1
|
||||
ELSE 0 END)), 0) otherAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMDIFF(HOUR, a.nad_time, now()) >= 168 and a.worker_classify = 1 THEN 1
|
||||
ELSE 0 END)), 0) ordinaryAcidNum,
|
||||
IFNULL(sum((CASE
|
||||
WHEN TIMESTAMPDPDIFF(HOUR, a.nad_time, now()) >= 72 and a.worker_classify = 3 THEN 1
|
||||
ELSE 0 END)), 0) outsideAcidNum
|
||||
from worker_info a
|
||||
WHERE project_sn = #{projectSn}
|
||||
and inService_type = 1
|
||||
and inService_type = 1
|
||||
</select>
|
||||
<select id="getPersonnelGrowth" resultType="com.zhgd.jeecg.common.mybatis.EntityMap">
|
||||
select DATE_FORMAT(enter_date, '%Y-%m') date, count(*) count
|
||||
@ -2194,7 +2198,7 @@
|
||||
<select id="getPersonnelList" resultType="com.zhgd.xmgl.modules.worker.entity.WorkerInfo">
|
||||
select wi.*, ti.team_name teamName
|
||||
from worker_info wi
|
||||
left join team_info ti on wi.team_id = ti.id and ti.project_sn = #{projectSn}
|
||||
left join team_info ti on wi.team_id = ti.id and ti.project_sn = #{projectSn}
|
||||
where wi.project_sn = #{projectSn}
|
||||
</select>
|
||||
|
||||
@ -2232,37 +2236,37 @@
|
||||
|
||||
<select id="getPersonnelSituation" resultType="com.zhgd.xmgl.modules.worker.entity.vo.PersonnelSituationVO">
|
||||
select
|
||||
-- 今日出勤
|
||||
IFNULL(sum(if(to_days(temp.create_time) = to_days(now()), 1, 0)), 0) todayAtte,
|
||||
-- 在场
|
||||
IFNULL(sum(if(temp.inService_type = 1, 1, 0)), 0) bePresent,
|
||||
-- 现场
|
||||
IFNULL(sum(if(temp.pass_type = 1, 1, 0)), 0) scene,
|
||||
-- 今日进场
|
||||
IFNULL(sum(if(temp.enter_date = current_date, 1, 0)), 0) todayMobilization,
|
||||
-- 今日退场
|
||||
IFNULL(sum(if(to_days(temp.exit_date) = to_days(now()), 1, 0)), 0) todayExit
|
||||
-- 今日出勤
|
||||
IFNULL(sum(if(to_days(temp.create_time) = to_days(now()), 1, 0)), 0) todayAtte,
|
||||
-- 在场
|
||||
IFNULL(sum(if(temp.inService_type = 1, 1, 0)), 0) bePresent,
|
||||
-- 现场
|
||||
IFNULL(sum(if(temp.pass_type = 1, 1, 0)), 0) scene,
|
||||
-- 今日进场
|
||||
IFNULL(sum(if(temp.enter_date = current_date, 1, 0)), 0) todayMobilization,
|
||||
-- 今日退场
|
||||
IFNULL(sum(if(to_days(temp.exit_date) = to_days(now()), 1, 0)), 0) todayExit
|
||||
from (select wa.create_time,
|
||||
wi.inService_type,
|
||||
wa.pass_type,
|
||||
wi.enter_date,
|
||||
wi.exit_date
|
||||
from worker_info wi
|
||||
left join
|
||||
(
|
||||
select wa.*
|
||||
from worker_attendance wa
|
||||
inner join
|
||||
(
|
||||
select max(`id`) as id
|
||||
from `worker_attendance`
|
||||
where project_sn = #{projectSn}
|
||||
group by `person_sn`
|
||||
) as a
|
||||
on a.id = wa.id) wa
|
||||
on wa.person_sn = wi.person_sn
|
||||
where wi.project_sn = #{projectSn}
|
||||
) temp
|
||||
wi.inService_type,
|
||||
wa.pass_type,
|
||||
wi.enter_date,
|
||||
wi.exit_date
|
||||
from worker_info wi
|
||||
left join
|
||||
(
|
||||
select wa.*
|
||||
from worker_attendance wa
|
||||
inner join
|
||||
(
|
||||
select max(`id`) as id
|
||||
from `worker_attendance`
|
||||
where project_sn = #{projectSn}
|
||||
group by `person_sn`
|
||||
) as a
|
||||
on a.id = wa.id) wa
|
||||
on wa.person_sn = wi.person_sn
|
||||
where wi.project_sn = #{projectSn}
|
||||
) temp
|
||||
</select>
|
||||
<select id="getWorkerInfoDetails" resultType="com.zhgd.xmgl.modules.worker.entity.vo.WorkerInfoDetailsVo">
|
||||
SELECT *
|
||||
@ -2302,4 +2306,14 @@
|
||||
LEFT JOIN worker_info wi ON (ti.id = wi.team_id and wi.inService_type = 1)
|
||||
GROUP BY wt.type_name
|
||||
</select>
|
||||
|
||||
<select id="getSpecialWorkerStatics" resultType="com.zhgd.xmgl.modules.worker.entity.vo.SpecialWorkerStaticsVo">
|
||||
SELECT COUNT(w.id) totalNum,
|
||||
ifnull((SELECT COUNT(id) FROM worker_attendance_presence WHERE person_sn = w.person_sn),0) inService
|
||||
FROM worker_info w
|
||||
RIGHT JOIN team_info t ON w.team_id = t.id
|
||||
RIGHT JOIN worker_type wt ON t.worker_type_id = wt.id
|
||||
WHERE wt.id = 11
|
||||
and w.project_sn = #{projectSn}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -9,6 +9,7 @@ import com.zhgd.xmgl.modules.worker.entity.vo.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -116,4 +117,6 @@ public interface IWorkerInfoService extends IService<WorkerInfo> {
|
||||
PresenceAndTotalNumberOfEngineeringPersonnelVo queryThePresenceAndTotalNumberOfEngineeringPersonnel();
|
||||
|
||||
List<TypeNumVo> countWorkerNumGroupByWorkerType(Map<String, Object> map);
|
||||
|
||||
SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map);
|
||||
}
|
||||
|
||||
@ -1738,6 +1738,12 @@ public class WorkerInfoServiceImpl extends ServiceImpl<WorkerInfoMapper, WorkerI
|
||||
return rtList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SpecialWorkerStaticsVo getSpecialWorkerStatics(HashMap<String, Object> map) {
|
||||
SpecialWorkerStaticsVo vo = workerInfoMapper.getSpecialWorkerStatics(map);
|
||||
return vo;
|
||||
}
|
||||
|
||||
private long getAttendanceNumber(String projectSn) {
|
||||
AtomicLong number = new AtomicLong(0);
|
||||
// 人员分组
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user