From c04f2d4a58bd72449b2212ed2f8b0c3ac9ec96be Mon Sep 17 00:00:00 2001 From: “djh” <“3298565835@qq.com”> Date: 星期二, 12 八月 2025 11:04:16 +0800 Subject: [PATCH] 修改 --- hazmat-system/src/main/resources/mapper/system/HzHazmatMapper.xml | 25 ++++++++++++++++++++----- 1 files changed, 20 insertions(+), 5 deletions(-) diff --git a/hazmat-system/src/main/resources/mapper/system/HzHazmatMapper.xml b/hazmat-system/src/main/resources/mapper/system/HzHazmatMapper.xml index 1ba56ea..893e884 100644 --- a/hazmat-system/src/main/resources/mapper/system/HzHazmatMapper.xml +++ b/hazmat-system/src/main/resources/mapper/system/HzHazmatMapper.xml @@ -149,13 +149,28 @@ </select> <select id="useCountStatic" resultType="com.gkhy.hazmat.system.domain.vo.HzHazmatUseVO"> - select count(*) as count,basic_id from hz_hazmat - where create_time >= #{startTime} and create_time <= #{endTime} and state =3 + SELECT + count(*) AS count, + hh2.basic_id + FROM + hz_hazmat hh2 + LEFT JOIN hz_hazmat_flow hhf2 on hh2.id = hhf2.hazmat_id + LEFT JOIN sys_user sy on hhf2.create_id = sy.id + LEFT JOIN sys_dept sd on sy.depart_id = sd.id + where hh2.create_time >= #{startTime} and hh2.create_time <= #{endTime} and hh2.state =3 and hhf2.state = 4 <if test="companyId!=null"> - and company_id=#{companyId} + and hh2.company_id=#{companyId} </if> - group by basic_id - order by count desc + <if test="userId!=null"> + and hhf2.create_id = #{userId} + </if> + <if test="departId!=null"> + and sd.id = #{departId} + </if> + GROUP BY + hh2.basic_id + ORDER BY + count DESC </select> -- Gitblit v1.9.2