大屏组件接口开发
正在显示
5 个修改的文件
包含
80 行增加
和
3 行删除
... | @@ -90,10 +90,21 @@ public class FactoryCenterController { | ... | @@ -90,10 +90,21 @@ public class FactoryCenterController { |
90 | 90 | ||
91 | //厂区削减量统计 | 91 | //厂区削减量统计 |
92 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") | 92 | @ApiOperation(value="厂区削减量统计", notes="厂区削减量统计") |
93 | @GetMapping(value = "/getSzXjltj") | 93 | @GetMapping(value = "/getXjltj") |
94 | public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) { | 94 | public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) { |
95 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); | 95 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); |
96 | List<Map<String, Object>> list = factoryCenterService.getYhtj(statisticsParam); | 96 | List<Map<String, Object>> list = factoryCenterService.getSzXjltj(statisticsParam); |
97 | result.setSuccess(true); | ||
98 | result.setResult(list); | ||
99 | return result; | ||
100 | } | ||
101 | |||
102 | //厂区削减量统计 | ||
103 | @ApiOperation(value="厂区设备统计", notes="厂区设备统计") | ||
104 | @GetMapping(value = "/getEquiptj") | ||
105 | public Result<List<Map<String, Object>>> getEquiptj(StatisticsParam statisticsParam) { | ||
106 | Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>(); | ||
107 | List<Map<String, Object>> list = factoryCenterService.getEquiptj(statisticsParam); | ||
97 | result.setSuccess(true); | 108 | result.setSuccess(true); |
98 | result.setResult(list); | 109 | result.setResult(list); |
99 | return result; | 110 | return result; | ... | ... |
... | @@ -31,4 +31,9 @@ public interface FactoryCenterMapper { | ... | @@ -31,4 +31,9 @@ public interface FactoryCenterMapper { |
31 | @Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb, | 31 | @Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb, |
32 | @Param("departId") String departId, | 32 | @Param("departId") String departId, |
33 | @Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb); | 33 | @Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb); |
34 | |||
35 | List<Map<String, Object>> getSzXjltj(@Param("startDate") String startDate, @Param("endDate") String endDate, | ||
36 | @Param("departId") String departId, @Param("view2119") String view2119); | ||
37 | |||
38 | List<Map<String, Object>> getEquiptj(@Param("departId") String departId); | ||
34 | } | 39 | } | ... | ... |
... | @@ -252,5 +252,45 @@ | ... | @@ -252,5 +252,45 @@ |
252 | GROUP BY | 252 | GROUP BY |
253 | LEFT ( v.time, 7 ) | 253 | LEFT ( v.time, 7 ) |
254 | </select> | 254 | </select> |
255 | 255 | <select id="getSzXjltj" resultType="java.util.HashMap"> | |
256 | SELECT | ||
257 | LEFT(v2.time,7) time, | ||
258 | ROUND(SUM(IFNULL(JSCOD,0)) - SUM(IFNULL(CSCOD,0)),2) AS COD, | ||
259 | ROUND(SUM(IFNULL(JSAD,0)) - SUM(IFNULL(CSAD,0)),2) AS NH3N, | ||
260 | ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN, | ||
261 | ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP | ||
262 | FROM | ||
263 | ${view2119tb} v2 | ||
264 | WHERE | ||
265 | v2.time >= #{startDate} | ||
266 | AND v2.time <= #{endDate} | ||
267 | <if test="departId!=null and departId!=''"> | ||
268 | AND v2.depart_id in | ||
269 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
270 | '${item}' | ||
271 | </foreach> | ||
272 | </if> | ||
273 | GROUP BY LEFT(v2.time,7) | ||
274 | </select> | ||
275 | <select id="getEquiptj" resultType="java.util.HashMap"> | ||
276 | SELECT | ||
277 | d.id departId, | ||
278 | d.depart_name departName, | ||
279 | IFNULL( t.num, 0 ) total, | ||
280 | IFNULL( y.num, 0 ) one, | ||
281 | IFNULL( r.num, 0 ) two | ||
282 | FROM | ||
283 | sys_depart d | ||
284 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info GROUP BY depart_id ) t ON d.id = t.depart_id | ||
285 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 1 GROUP BY depart_id ) y ON d.id = y.depart_id | ||
286 | LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info WHERE energy_level = 2 GROUP BY depart_id ) r ON d.id = r.depart_id | ||
287 | WHERE | ||
288 | d.depart_type = 1 | ||
289 | <if test="departId!=null and departId!=''"> | ||
290 | AND d.id IN | ||
291 | <foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")"> | ||
292 | '${item}' | ||
293 | </foreach> | ||
294 | </if> | ||
295 | </select> | ||
256 | </mapper> | 296 | </mapper> | ... | ... |
... | @@ -28,5 +28,9 @@ public interface IFactoryCenterService { | ... | @@ -28,5 +28,9 @@ public interface IFactoryCenterService { |
28 | Map<String, Object> getMonitorThreshold(String departId); | 28 | Map<String, Object> getMonitorThreshold(String departId); |
29 | 29 | ||
30 | Map<String, Object> getHourWaterData(StatisticsParam statisticsParam); | 30 | Map<String, Object> getHourWaterData(StatisticsParam statisticsParam); |
31 | |||
32 | List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam); | ||
33 | |||
34 | List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam); | ||
31 | } | 35 | } |
32 | 36 | ... | ... |
... | @@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { | ... | @@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService { |
531 | return map; | 531 | return map; |
532 | } | 532 | } |
533 | 533 | ||
534 | @Override | ||
535 | public List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam) { | ||
536 | List<Map<String, Object>> list = new ArrayList<>(); | ||
537 | String startDate = statisticsParam.getStartDate(); | ||
538 | String endDate = statisticsParam.getEndDate(); | ||
539 | String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate); | ||
540 | list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119); | ||
541 | return list; | ||
542 | } | ||
543 | |||
544 | @Override | ||
545 | public List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam) { | ||
546 | List<Map<String, Object>> list = new ArrayList<>(); | ||
547 | list = factoryCenterMapper.getEquiptj(statisticsParam.getDepartId()); | ||
548 | return list; | ||
549 | } | ||
550 | |||
534 | /** | 551 | /** |
535 | * 获取时间之间的月份 | 552 | * 获取时间之间的月份 |
536 | * @param start | 553 | * @param start | ... | ... |
-
请 注册 或 登录 后发表评论