提交代码
parent
4b9a42c288
commit
cdcefab554
|
@ -92,8 +92,7 @@ public class ProblemmodifyController extends BaseController {
|
|||
|
||||
/**
|
||||
* 质量整改-安全分类汇总(按项目)
|
||||
* @param deptId
|
||||
* @param roleType
|
||||
* @param where 查询条件
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/safetySummaryByProject")
|
||||
|
|
|
@ -425,31 +425,34 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</delete>
|
||||
|
||||
<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
|
||||
<where>
|
||||
<if test="infoType==0">and dict_type='ssp_aqyhlx'</if>
|
||||
<if test="infoType>0">and dict_type='ssp_zlyhlx'</if>
|
||||
|
||||
</where>
|
||||
) a
|
||||
LEFT JOIN ( SELECT danger_type,COUNT(1) cnt FROM smz_ssp_problemmodify WHERE projectId IN(
|
||||
SELECT id FROM sur_project
|
||||
where isDel=0
|
||||
<if test="projectId>0">and projectId=#{projectId}</if>
|
||||
<if test="deptId >0 ">AND deptid = #{deptId}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
) AND infotype=#{infoType} and isDel=0
|
||||
<if test="roleType > 0">AND roletype=#{roleType}</if>
|
||||
<if test="startDate!=null">and DATE(createtime)>=DATE(#{startDate})</if>
|
||||
<if test="endDate!=null">and DATE(createtime) <= DATE(#{endDate})</if>
|
||||
GROUP BY danger_type) b
|
||||
ON a.dict_value=b.danger_type ORDER BY cnt DESC,a.dict_value+0
|
||||
SELECT
|
||||
sp.danger_type as id,
|
||||
sd.dict_label as problemArea,
|
||||
COUNT(1) as roleType
|
||||
FROM
|
||||
smz_ssp_problemmodify sp
|
||||
left join sys_dict_data sd on sd.dict_value=sp.danger_type
|
||||
<if test="infoType==0">and sd.dict_type = 'ssp_aqyhlx'</if>
|
||||
<if test="infoType==1">and sd.dict_type = 'ssp_zlyhlx'</if>
|
||||
WHERE sp.isDel = 0
|
||||
AND sp.infotype = #{infoType}
|
||||
<if test="roleType > 0">AND sp.roletype=#{roleType}</if>
|
||||
<if test="startDate!=null">and DATE(sp.createtime) >= DATE(#{startDate})</if>
|
||||
<if test="endDate!=null">and DATE(sp.createtime) <= DATE(#{endDate})</if>
|
||||
<if test="projectId>0">and sp.projectId=#{projectId}</if>
|
||||
<if test="deptId >0 ">AND sp.deptid = #{deptId}</if>
|
||||
<if test="prjIds !=null and prjIds.size()>0">
|
||||
and sp.projectId in
|
||||
<foreach collection="prjIds" item="item" index="index" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
GROUP BY
|
||||
sp.danger_type
|
||||
ORDER BY
|
||||
roleType desc
|
||||
</select>
|
||||
|
||||
<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,
|
||||
if(c.timoutComp is null,0,c.timoutComp) checkState,
|
||||
|
|
Loading…
Reference in New Issue