Commit 29cd3843 authored by tianbo's avatar tianbo

fix:安全追溯-企业隐患(近30天)维保超期统计修改

parent eb2022ea
...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper { ...@@ -79,4 +79,8 @@ public interface AQZSDPStatisticsMapper {
List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto); List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel); Page<SafetyProblemTracingDto> queryForSafetyProblemTracingPage(Page<SafetyProblemTracingDto> page, SafetyProblemTracingDto problemModel);
CountDto selectByOrgAndProblemTypeForWb(@Param("orgCode") String orgCode, @Param("problemTypeCode") String problemTypeCode,
@Param("dto") DPFilterParamDto dpFilterParamDto, @Param("sourceTypeCode") String sourceTypeCode, @Param("equListCode") String equListCode);
} }
...@@ -422,6 +422,33 @@ ...@@ -422,6 +422,33 @@
</where> </where>
order by spt.create_date desc order by spt.create_date desc
</select> </select>
<select id="selectByOrgAndProblemTypeForWb" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
COUNT(1) as longValue,
t.problem_type AS keyStr
FROM
(SELECT problem_type FROM
tzs_safety_problem_tracing
WHERE
governing_body_org_code LIKE concat ( #{orgCode}, '%' )
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(problem_time as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(problem_time as date),#{dto.endDate})
</if>
<if test="null != sourceTypeCode">
AND source_type_code = #{sourceTypeCode}
</if>
<if test="null != equListCode">
AND equip_list_code = #{equListCode}
</if>
<if test="null != problemTypeCode">
AND problem_type_code = #{problemTypeCode}
</if>
GROUP BY
principal_unit_code) t
</select>
</mapper> </mapper>
...@@ -454,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -454,6 +454,9 @@ public class AQZSDPStatisticsServiceImpl {
if (orgCode != null) { if (orgCode != null) {
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getCode(), null);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
// 企业维保合同过期单独查询(企业下有设备维保超期就算)
CountDto wbCountDto = statisticsMapper.selectByOrgAndProblemTypeForWb(orgCode, IssueTypeEnum.MAINTENANCE_OVERDUE_EQUMENT.getCode(), dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), "3000");
dataMap.put(IssueTypeEnum.MAINTENANCE_RECORD_OVERDUE_COMPANY.getName(), wbCountDto == null ? 0 : wbCountDto.getLongValue());
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
Map<String, Object> map = new HashMap<>(); Map<String, Object> map = new HashMap<>();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment