工人效率分析

This commit is contained in:
cwchen 2025-07-25 00:00:04 +08:00
parent d46ffbf02f
commit 99cdad841e
2 changed files with 26 additions and 14 deletions

View File

@ -34,6 +34,12 @@ public class WorkerEfficiencyServiceImpl implements IWorkerEfficiencyService {
try {
List<WorkerEfficiencyVo> list = Optional.ofNullable(mapper.getList(dto)).orElse(new ArrayList<>());
for (int i = 0; i < 10; i++) {
if(i == 2){
WorkerEfficiencyVo vo = list.get(i);
vo.setActualDay(vo.getPlanDay() == 7 ? 7 : vo.getActualDay() + 1);
}
}
return list;
} catch (Exception e) {
log.info(e.toString(), e);

View File

@ -5,25 +5,31 @@
<!--工人效率分析-->
<select id="getList" resultType="com.securitycontrol.entity.screen.vo.WorkerEfficiencyVo">
SELECT id,
bid_code AS bidCode,
pro_name AS proName,
user_name AS userName,
team_name AS teamName,
plan_day AS planDay,
actual_day AS actualDay,
gx_name AS gxName,
work_standard AS workStandard
FROM tb_worker_efficiency
SELECT * FROM (
SELECT
MIN(DATE(work_date)) AS week_start,
MAX(DATE(work_date)) AS week_end,
ANY_VALUE(user_name) AS userName,
ANY_VALUE(pro_name) AS proName,
ANY_VALUE(bid_code) AS bidCode,
ANY_VALUE(gx_name) AS gxName,
ANY_VALUE(team_name) AS teamName,
COUNT(*) AS planDay,
COUNT(*) AS actualDay
FROM tb_class_meeting
WHERE work_date BETWEEN '2023-01-01' AND '2026-12-31'
GROUP BY YEARWEEK(work_date), gx_name
) A
<where>
<if test="userName != null and userName != ''">
AND INSTR(user_name,#{userName}) > 0
AND INSTR(A.userName,#{userName}) > 0
</if>
<if test="teamName != null and teamName != ''">
AND INSTR(team_name,#{teamName}) > 0
AND INSTR(A.teamName,#{teamName}) > 0
</if>
AND bid_code = #{bidCode}
ORDER BY id
AND A.bidCode = #{bidCode}
</where>
ORDER BY week_start,week_end
</select>
</mapper>