dev_xds
haha 2024-03-26 01:06:17 +08:00
commit 745f2ee510
2 changed files with 28 additions and 26 deletions

View File

@ -92,8 +92,7 @@ public class ProblemmodifyController extends BaseController {
/** /**
* -() * -()
* @param deptId * @param where
* @param roleType
* @return * @return
*/ */
@PostMapping("/safetySummaryByProject") @PostMapping("/safetySummaryByProject")

View File

@ -425,31 +425,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete> </delete>
<select id="selectSummary" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult"> <select id="selectSummary" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
SELECT a.dict_value id,a.dict_label problemArea,b.cnt roleType FROM (SELECT * FROM sys_dict_data SELECT
<where> sp.danger_type as id,
<if test="infoType==0">and dict_type='ssp_aqyhlx'</if> sd.dict_label as problemArea,
<if test="infoType>0">and dict_type='ssp_zlyhlx'</if> COUNT(1) as roleType
FROM
</where> smz_ssp_problemmodify sp
) a left join sys_dict_data sd on sd.dict_value=sp.danger_type
LEFT JOIN ( SELECT danger_type,COUNT(1) cnt FROM smz_ssp_problemmodify WHERE projectId IN( <if test="infoType==0">and sd.dict_type = 'ssp_aqyhlx'</if>
SELECT id FROM sur_project <if test="infoType==1">and sd.dict_type = 'ssp_zlyhlx'</if>
where isDel=0 WHERE sp.isDel = 0
<if test="projectId>0">and projectId=#{projectId}</if> AND sp.infotype = #{infoType}
<if test="deptId >0 ">AND deptid = #{deptId}</if> <if test="roleType > 0">AND sp.roletype=#{roleType}</if>
<if test="prjIds !=null and prjIds.size()>0"> <if test="startDate!=null">and DATE(sp.createtime) &gt;= DATE(#{startDate})</if>
and projectId in <if test="endDate!=null">and DATE(sp.createtime) &lt;= DATE(#{endDate})</if>
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=","> <if test="projectId>0">and sp.projectId=#{projectId}</if>
#{item} <if test="deptId >0 ">AND sp.deptid = #{deptId}</if>
</foreach> <if test="prjIds !=null and prjIds.size()>0">
</if> and sp.projectId in
) AND infotype=#{infoType} and isDel=0 <foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
<if test="roleType > 0">AND roletype=#{roleType}</if> #{item}
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if> </foreach>
<if test="endDate!=null">and DATE(createtime) &lt;= DATE(#{endDate})</if> </if>
GROUP BY danger_type) b GROUP BY
ON a.dict_value=b.danger_type ORDER BY cnt DESC,a.dict_value+0 sp.danger_type
ORDER BY
roleType desc
</select> </select>
<select id="selectSummaryByProject" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult"> <select id="selectSummaryByProject" parameterType="SmzSspProblemmodifyWhere" resultMap="SmzSspProblemmodifyResult">
select a.projectId,a.prjName projectName,a.proble id,if(b.timoutNoComp is null,0,b.timoutNoComp) infoType, select a.projectId,a.prjName projectName,a.proble id,if(b.timoutNoComp is null,0,b.timoutNoComp) infoType,
if(c.timoutComp is null,0,c.timoutComp) checkState, if(c.timoutComp is null,0,c.timoutComp) checkState,