636fed5a 张雷

大屏组件接口开发

1 个父辈 f3d6fcf1
......@@ -90,10 +90,21 @@ public class FactoryCenterController {
//厂区削减量统计
@ApiOperation(value="厂区削减量统计", notes="厂区削减量统计")
@GetMapping(value = "/getSzXjltj")
@GetMapping(value = "/getXjltj")
public Result<List<Map<String, Object>>> getSzXjltj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getYhtj(statisticsParam);
List<Map<String, Object>> list = factoryCenterService.getSzXjltj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
}
//厂区削减量统计
@ApiOperation(value="厂区设备统计", notes="厂区设备统计")
@GetMapping(value = "/getEquiptj")
public Result<List<Map<String, Object>>> getEquiptj(StatisticsParam statisticsParam) {
Result<List<Map<String, Object>>> result = new Result<List<Map<String, Object>>>();
List<Map<String, Object>> list = factoryCenterService.getEquiptj(statisticsParam);
result.setSuccess(true);
result.setResult(list);
return result;
......
......@@ -31,4 +31,9 @@ public interface FactoryCenterMapper {
@Param("startDateTb") String startDateTb, @Param("endDateTb") String endDateTb,
@Param("departId") String departId,
@Param("view3a24") String view3a24, @Param("view3a24tb") String view3a24tb);
List<Map<String, Object>> getSzXjltj(@Param("startDate") String startDate, @Param("endDate") String endDate,
@Param("departId") String departId, @Param("view2119") String view2119);
List<Map<String, Object>> getEquiptj(@Param("departId") String departId);
}
......
......@@ -252,5 +252,45 @@
GROUP BY
LEFT ( v.time, 7 )
</select>
<select id="getSzXjltj" resultType="java.util.HashMap">
SELECT
LEFT(v2.time,7) time,
ROUND(SUM(IFNULL(JSCOD,0)) - SUM(IFNULL(CSCOD,0)),2) AS COD,
ROUND(SUM(IFNULL(JSAD,0)) - SUM(IFNULL(CSAD,0)),2) AS NH3N,
ROUND(SUM(IFNULL(JSZD,0)) - SUM(IFNULL(CSTN,0)),2) AS TN,
ROUND(SUM(IFNULL(JSZL,0)) - SUM(IFNULL(CSZL,0)),2) AS TP
FROM
${view2119tb} v2
WHERE
v2.time &gt;= #{startDate}
AND v2.time &lt;= #{endDate}
<if test="departId!=null and departId!=''">
AND v2.depart_id in
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
GROUP BY LEFT(v2.time,7)
</select>
<select id="getEquiptj" resultType="java.util.HashMap">
SELECT
d.id departId,
d.depart_name departName,
IFNULL( t.num, 0 ) total,
IFNULL( y.num, 0 ) one,
IFNULL( r.num, 0 ) two
FROM
sys_depart d
LEFT JOIN ( SELECT depart_id, count( id ) num FROM equipment_info GROUP BY depart_id ) t ON d.id = t.depart_id
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
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
WHERE
d.depart_type = 1
<if test="departId!=null and departId!=''">
AND d.id IN
<foreach item="item" index="index" collection="departId.split(',')" open="(" separator="," close=")">
'${item}'
</foreach>
</if>
</select>
</mapper>
......
......@@ -28,5 +28,9 @@ public interface IFactoryCenterService {
Map<String, Object> getMonitorThreshold(String departId);
Map<String, Object> getHourWaterData(StatisticsParam statisticsParam);
List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam);
List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam);
}
......
......@@ -531,6 +531,23 @@ public class FactoryCenterServiceImpl implements IFactoryCenterService {
return map;
}
@Override
public List<Map<String, Object>> getSzXjltj(StatisticsParam statisticsParam) {
List<Map<String, Object>> list = new ArrayList<>();
String startDate = statisticsParam.getStartDate();
String endDate = statisticsParam.getEndDate();
String dataView2119 = ReportViewUtil.buildView(view2119, "CSL", statisticsParam.getDepartId(), startDate, endDate);
list = factoryCenterMapper.getSzXjltj(startDate,endDate,statisticsParam.getDepartId(),dataView2119);
return list;
}
@Override
public List<Map<String, Object>> getEquiptj(StatisticsParam statisticsParam) {
List<Map<String, Object>> list = new ArrayList<>();
list = factoryCenterMapper.getEquiptj(statisticsParam.getDepartId());
return list;
}
/**
* 获取时间之间的月份
* @param start
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!