企业报告 高危作业数据

pull/5/head
fangjiakai 2024-02-28 09:34:29 +08:00
parent d8b90b8533
commit d1def6945d
5 changed files with 52 additions and 1 deletions

View File

@ -2,7 +2,9 @@ package com.zcloud.controller.eightwork;
import com.zcloud.controller.base.BaseController; import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.service.corp.CorpInfoService; import com.zcloud.service.corp.CorpInfoService;
import com.zcloud.service.eightwork.EightWorkService;
import com.zcloud.util.*; import com.zcloud.util.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
@ -22,6 +24,8 @@ public class EightWorkController extends BaseController {
@Autowired @Autowired
private CorpInfoService corpInfoService; private CorpInfoService corpInfoService;
@Autowired
private EightWorkService eightWorkService;
/** /**
* @param * @param
@ -40,4 +44,28 @@ public class EightWorkController extends BaseController {
map.put("result", errInfo); map.put("result", errInfo);
return map; return map;
} }
/**
* @param
* @throws Exception
*/
@RequestMapping(value="/getDiagnosis")
@ResponseBody
public Object getDiagnosis() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd.put("CORPINFO_ID",Jurisdiction.getCORPINFO_ID());
List<PageData> eightlist = eightWorkService.listAllForDiagnosis(pd);
map.put("eightlist", eightlist);
if(pd!=null) {
errInfo = "success";
}else {
errInfo = "faild";
}
map.put("result", errInfo);
return map;
}
} }

View File

@ -14,5 +14,7 @@ import java.util.List;
public interface EightWorkMapper { public interface EightWorkMapper {
List<PageData> getEightWorks(PageData corp); List<PageData> getEightWorks(PageData corp);
List<PageData> listAllForDiagnosis(PageData pd);
} }

View File

@ -17,4 +17,6 @@ public interface EightWorkService {
ReturnMap getEightWorks()throws Exception; ReturnMap getEightWorks()throws Exception;
List<PageData> list(PageData pd)throws Exception; List<PageData> list(PageData pd)throws Exception;
List<PageData> listAllForDiagnosis(PageData pd)throws Exception;
} }

View File

@ -106,6 +106,8 @@ public class EightWorkServiceImpl implements EightWorkService {
}).collect(Collectors.toList()); }).collect(Collectors.toList());
return returnList; return returnList;
} }
public List<PageData> listAllForDiagnosis(PageData pd)throws Exception{
return eightworkMapper.listAllForDiagnosis(pd);
}
} }

View File

@ -14,4 +14,21 @@
order by tmp.ACT_TIME DESC order by tmp.ACT_TIME DESC
</select> </select>
<select id="listAllForDiagnosis" parameterType="pd" resultType="pd">
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_BLINDBOARD f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_BREAKGROUND f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_CONFINEDSPACE f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_ELECTRICITY f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_CUTROAD f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_HIGHWORK f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_HOISTING f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
union all
select count(1) as count,sum(case when f.STEP_ID=15 then 1 else 0 end) as pass_count from BUS_HOTWORK f where DATE_FORMAT(f.CREATTIME,'%Y-%m')=#{MONTH} and f.CORPINFO_ID = #{CORPINFO_ID}
</select>
</mapper> </mapper>