大屏代码提交

This commit is contained in:
lizhenhua 2026-01-23 17:47:48 +08:00
parent 196c25159c
commit c30b99a5ec
5 changed files with 77 additions and 53 deletions

View File

@ -33,6 +33,9 @@ public class SjNewConstructionProgress extends BaseEntity {
/** 当前进度 */
private String progress;
/** 实际进度 */
private String sjprogress;
/** 实际结束时间 */
private String endTime;

View File

@ -82,4 +82,5 @@ public class SjNewProjectSafety extends BaseEntity {
*/
private String startTime;
private String endTime;
private String projectId;
}

View File

@ -6,40 +6,52 @@
parameterType="com.securitycontrol.screen.domain.SjNewConstructionProgress"
resultType="com.securitycontrol.screen.domain.SjNewConstructionProgress">
SELECT
id,
gx_type AS gxType,
gx,
plan_start_time AS planStartTime,
plan_end_time AS planEndTime,
in_user AS inUser,
in_device AS inDevice,
progress,
end_time AS endTime,
status,
project_id AS projectId,
create_time,
update_time,
remark
FROM sj_new_construction_progress
p.id,
p.gx_type AS gxType,
p.gx,
p.plan_start_time AS planStartTime,
p.plan_end_time AS planEndTime,
p.in_user AS inUser,
p.in_device AS inDevice,
p.progress,
p.end_time AS endTime,
p.status,
p.project_id AS projectId,
p.create_time,
p.update_time,
p.remark,
r.plan_progress AS sjprogress <!-- 最新计划进度 -->
FROM sj_new_construction_progress p
LEFT JOIN (
SELECT r1.progress_id, r1.plan_progress
FROM sj_new_construction_progress_real r1
INNER JOIN (
SELECT progress_id, MAX(create_time) AS max_create_time
FROM sj_new_construction_progress_real
GROUP BY progress_id
) r2
ON r1.progress_id = r2.progress_id
AND r1.create_time = r2.max_create_time
) r ON p.id = r.progress_id
<where>
<if test="projectId != null and projectId != ''">
AND project_id = #{projectId}
AND p.project_id = #{projectId}
</if>
<if test="gxType != null and gxType != ''">
AND gx_type = #{gxType}
AND p.gx_type = #{gxType}
</if>
<if test="status != null and status != ''">
AND status = #{status}
AND p.status = #{status}
</if>
<if test="startTime != null and startTime != ''">
AND plan_start_time &gt;= #{startTime}
AND p.plan_start_time &gt;= #{startTime}
</if>
<if test="endTime != null and endTime != ''">
AND plan_end_time &lt;= #{endTime}
AND p.plan_end_time &lt;= #{endTime}
</if>
</where>
ORDER BY plan_start_time DESC
</select>
ORDER BY p.plan_start_time DESC
</select>
<select id="selectProgressSummary"
resultType="com.securitycontrol.screen.domain.SjNewConstructionProgress">
SELECT

View File

@ -39,6 +39,9 @@
<if test="endTime != null and endTime != ''">
AND detection_time &lt;= #{endTime}
</if>
<if test="projectId != null and projectId != ''">
AND project_id = #{projectId}
</if>
</where>
ORDER BY detection_time DESC
</select>

View File

@ -6,33 +6,35 @@
<select id="selectProjectQualityList"
parameterType="com.securitycontrol.screen.domain.SjNewProjectQuality"
resultType="com.securitycontrol.screen.domain.SjNewProjectQuality">
SELECT
id,
team_name AS teamName,
content,
test_day AS testDay,
test_result AS testResult,
test_report AS testReport,
del_flag AS delFlag,
create_time
FROM sj_new_project_quality
WHERE del_flag = '0'
<if test="projectId != null and projectId != ''">
and project_id = #{projectId}
SELECT
q.id,
t.team_name AS teamName,
q.content,
q.test_day AS testDay,
q.test_result AS testResult,
q.test_report AS testReport,
q.del_flag AS delFlag,
q.create_time
FROM sj_new_project_quality q
LEFT JOIN sj_work_team t
ON q.team_name = t.id
WHERE
q.del_flag = '0'
<if test="projectId != null and projectId != ''">
AND q.project_id = #{projectId}
</if>
<if test="teamName != null and teamName != ''">
AND team_name LIKE CONCAT('%', #{teamName}, '%')
AND t.team_name LIKE CONCAT('%', #{teamName}, '%')
</if>
<if test="testResult != null and testResult != ''">
AND test_result = #{testResult}
AND q.test_result = #{testResult}
</if>
<if test="startTestDay != null and startTestDay != ''">
AND test_day &gt;= #{startTestDay}
AND q.test_day &gt;= #{startTestDay}
</if>
<if test="endTestDay != null and endTestDay != ''">
AND test_day &lt;= #{endTestDay}
AND q.test_day &lt;= #{endTestDay}
</if>
ORDER BY create_time DESC
</select>
<!-- 质量预警列表 -->
@ -70,28 +72,31 @@
</select>
<select id="selectTeamPassRate" resultType="com.securitycontrol.screen.domain.SjNewProjectQuality">
SELECT
team_name AS teamName,
COUNT(*) AS totalCount,
SUM(CASE WHEN test_report = '0' THEN 1 ELSE 0 END) AS passCount,
tp.team_name AS teamName,
COUNT(q.id) AS totalCount,
SUM(CASE WHEN q.test_result = '0' THEN 1 ELSE 0 END) AS passCount,
ROUND(
SUM(CASE WHEN test_report = '0' THEN 1 ELSE 0 END)
/ COUNT(*) * 100, 2
SUM(CASE WHEN q.test_result = '0' THEN 1 ELSE 0 END) / COUNT(q.id) * 100,
2
) AS passRate
FROM sj_new_project_quality
WHERE del_flag = '0'
AND project_id = #{projectId}
FROM
sj_new_project_quality q
LEFT JOIN sj_work_team tp
ON q.team_name = tp.id
WHERE q.del_flag = '0'
AND q.project_id = #{projectId}
<if test="startTestDay != null and startTestDay != ''">
AND test_day &gt;= #{startTestDay}
AND q.test_day &gt;= #{startTestDay}
</if>
<if test="endTestDay != null and endTestDay != ''">
AND test_day &lt;= #{endTestDay}
AND q.test_day &lt;= #{endTestDay}
</if>
GROUP BY team_name
GROUP BY tp.team_name
</select>
<select id="selectResultCount" resultType="com.securitycontrol.screen.domain.SjNewProjectQuality">
SELECT
SUM(CASE WHEN test_report = '0' THEN 1 ELSE 0 END) AS passCount,
SUM(CASE WHEN test_report = '1' THEN 1 ELSE 0 END) AS failCount
SUM(CASE WHEN test_result = '0' THEN 1 ELSE 0 END) AS passCount,
SUM(CASE WHEN test_result = '1' THEN 1 ELSE 0 END) AS failCount
FROM sj_new_project_quality
WHERE del_flag = '0'
<if test="startTestDay != null and startTestDay != ''">