Commit 484eb7e5 authored by suhuiguang's avatar suhuiguang

1.1.大屏-安全追溯-问题主体接口调整

parent b36b0385
...@@ -14,9 +14,7 @@ public enum IssueMainBodyEnum { ...@@ -14,9 +14,7 @@ public enum IssueMainBodyEnum {
//企业 //企业
COMPANY("企业","2"), COMPANY("企业","2"),
//设备 //设备
EQUIPMENT("设备","3"), EQUIPMENT("设备","3");
;
String name; String name;
String code; String code;
......
...@@ -25,7 +25,7 @@ public interface AQZSDPStatisticsMapper { ...@@ -25,7 +25,7 @@ public interface AQZSDPStatisticsMapper {
List<CountDto> selectByOrgAndProblemType(@Param("orgCode") String orgCode, @Param("enumNameList") List<String> enumNameList, List<CountDto> selectByOrgAndProblemType(@Param("orgCode") String orgCode, @Param("enumNameList") List<String> enumNameList,
@Param("dto") DPFilterParamDto startDate, @Param("sourceType") String sourceType, @Param("equipType") String equipType); @Param("dto") DPFilterParamDto dpFilterParamDto, @Param("sourceTypeCode") String sourceTypeCode, @Param("equListCode") String equListCode);
List<Map<String, Object>> getIssueCountByMonth(@Param("orgCode") String orgCode, @Param("year") String year, @Param("status") String status); List<Map<String, Object>> getIssueCountByMonth(@Param("orgCode") String orgCode, @Param("year") String year, @Param("status") String status);
...@@ -72,4 +72,7 @@ public interface AQZSDPStatisticsMapper { ...@@ -72,4 +72,7 @@ public interface AQZSDPStatisticsMapper {
List<Map<String, Object>> selectByOrg(String orgCode); List<Map<String, Object>> selectByOrg(String orgCode);
List<Map<String, Object>> cylinderIssueMonthList(@Param("orgCode") String orgCode, @Param("time") String time); List<Map<String, Object>> cylinderIssueMonthList(@Param("orgCode") String orgCode, @Param("time") String time);
List<CountDto> selectByOrgAndProblemTypeForCy(@Param("orgCode") String orgCode, @Param("dto") DPFilterParamDto dpFilterParamDto);
} }
...@@ -37,9 +37,9 @@ ...@@ -37,9 +37,9 @@
<if test="dto.endDate !=null and dto.endDate !=''"> <if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(problem_time as date),#{dto.endDate}) and date_le(CAST(problem_time as date),#{dto.endDate})
</if> </if>
AND source_type = #{sourceType} AND source_type_code = #{sourceTypeCode}
<if test="null != equipType"> <if test="null != equipType">
AND equip_list_code = #{equipType} AND equip_list_code = #{equListCode}
</if> </if>
AND problem_type IN AND problem_type IN
<foreach collection="enumNameList" item="item" separator="," open="(" close=")"> <foreach collection="enumNameList" item="item" separator="," open="(" close=")">
...@@ -47,7 +47,26 @@ ...@@ -47,7 +47,26 @@
</foreach> </foreach>
GROUP BY GROUP BY
problem_type problem_type
</select>
<select id="selectByOrgAndProblemTypeForCy" resultType="com.yeejoin.amos.boot.biz.common.dto.CountDto">
SELECT
COUNT(1) as longValue,
t.problem_type AS keyStr
FROM
tzs_safety_problem_tracing t,
idx_biz_jg_register_info A
WHERE
A.RECORD = t.source_id
AND A.EQU_CATEGORY = '2300'
and t.governing_body_org_code LIKE concat (#{orgCode}, '%')
<if test="dto.beginDate !=null and dto.beginDate !=''">
and date_ge(CAST(t.problem_time as date),#{dto.beginDate})
</if>
<if test="dto.endDate !=null and dto.endDate !=''">
and date_le(CAST(t.problem_time as date),#{dto.endDate})
</if>
AND t.source_type_code = '3'
GROUP BY t.problem_type
</select> </select>
<select id="getIssueCountByMonth" resultType="java.util.Map"> <select id="getIssueCountByMonth" resultType="java.util.Map">
SELECT COUNT SELECT COUNT
......
...@@ -377,7 +377,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -377,7 +377,7 @@ public class AQZSDPStatisticsServiceImpl {
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("3");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode != null){ if(orgCode != null){
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getName(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getCode(), null);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
...@@ -396,7 +396,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -396,7 +396,7 @@ public class AQZSDPStatisticsServiceImpl {
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("2");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode != null){ if(orgCode != null){
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.COMPANY.getName(), 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()));
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
...@@ -434,7 +434,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -434,7 +434,7 @@ public class AQZSDPStatisticsServiceImpl {
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("1");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode != null){ if(orgCode != null){
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.PERSON.getName(), null); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.PERSON.getCode(), null);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
...@@ -455,7 +455,7 @@ public class AQZSDPStatisticsServiceImpl { ...@@ -455,7 +455,7 @@ public class AQZSDPStatisticsServiceImpl {
List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4"); List<String> enumNameList = IssueTypeEnum.getEnumNameListByMainBody("4");
String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode()); String orgCode = stCommonService.getAndSetOrgCode(dpFilterParamDto.getCityCode());
if(orgCode != null){ if(orgCode != null){
List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemType(orgCode, enumNameList, dpFilterParamDto, IssueMainBodyEnum.EQUIPMENT.getName(), "2300"); List<CountDto> countDtos = statisticsMapper.selectByOrgAndProblemTypeForCy(orgCode, dpFilterParamDto);
countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue())); countDtos.forEach(t -> dataMap.put(t.getKeyStr(), t.getLongValue()));
} }
for (int i = 0; i < enumNameList.size(); i++) { for (int i = 0; i < enumNameList.size(); i++) {
......
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