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