Commit 47ec6628 authored by 李秀明's avatar 李秀明

Merge remote-tracking branch 'origin/develop_dl_bugfix_0723' into develop_dl_bugfix_0723

parents 0c2be6c1 3030f80e
package com.yeejoin.equipmanage.controller;
import cn.hutool.core.util.StrUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -231,8 +232,7 @@ public class PoolStatisticController {
sortOrder = sorter.split("@")[1];
}
Page<Map<String, Object>> page1 = fireFightingSystemMapper.getWaterInfoList(page, bizOrgCode, sortField, sortOrder, status);
List<Map<String, Object>> res = page1.getRecords();
List<Map<String, Object>> res = fireFightingSystemMapper.getWaterInfoList(bizOrgCode, sortField, sortOrder);
if (!res.isEmpty()) {
for (Map<String, Object> m : res) {
Map<String, Object> transResult = UnitTransformUtil.transformValues(String.valueOf(m.get("nowLevel")),
......@@ -263,9 +263,19 @@ public class PoolStatisticController {
m.put("status", "0");
}
}
page1.setRecords(res);
if (StrUtil.isNotEmpty(status)) {
String finalStatus = status;
res = res.stream().filter(item -> finalStatus.equals(item.get("status").toString())).collect(Collectors.toList());
}
page.setTotal(res.size());
List<Map<String, Object>> collect = res.stream()
.skip((long) (commonPageable.getPageNumber() - 1) * commonPageable.getPageSize())
.limit(commonPageable.getPageSize())
.collect(Collectors.toList());
page.setRecords(collect);
}
return CommonResponseUtil.success(page1);
return CommonResponseUtil.success(page);
}
@RequestMapping(value = "/selectWaterLevelDetail", method = RequestMethod.GET)
......
......@@ -356,7 +356,7 @@ public interface FireFightingSystemMapper extends BaseMapper<FireFightingSystemE
* @param bizOrgCode
* @return
*/
Page<Map<String, Object>> getWaterInfoList(Page page, @Param("bizOrgCode") String bizOrgCode, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder, @Param("status") String status);
List<Map<String, Object>> getWaterInfoList(@Param("bizOrgCode") String bizOrgCode, @Param("sortField") String sortField, @Param("sortOrder") String sortOrder);
/**
* 水源信息统计
......
......@@ -343,10 +343,7 @@ public interface PlanTaskMapper extends BaseMapper {
List<Map<String, Object>> queryPatrolInfo(@Param(value="bizOrgCode") String bizOrgCode, @Param(value="startDate") Date startDate, @Param(value="endDate") Date endDate);
List<HashMap<String, Object>> selectPatrolRecordPage(
@Param(value="offset") long offset,
@Param(value="pageSize") long pageSize,
@Param(value="bizOrgCode") String bizOrgCode,
@Param(value="missStatus") String missStatus,
@Param(value="date") String date
);
Long selectPatrolRecordTotal(
......@@ -359,4 +356,10 @@ public interface PlanTaskMapper extends BaseMapper {
@Param(value="bizOrgCode") String bizOrgCode,
@Param(value="date") String date
);
Integer getDoneNum(@Param(value="bizOrgCode") String bizOrgCode,
@Param(value="date") String date);
List<Map<String, Object>> getDoneList(@Param(value="bizOrgCode") String bizOrgCode,
@Param(value="date") String date);
}
......@@ -5273,11 +5273,7 @@
) a1
)) b1
) c1 GROUP BY bizOrgName1) d ON d.bizOrgName1 = c.bizOrgName
<where>
<if test="status != null and status != ''">
c.`status` = #{status}
</if>
</where>
<if test="sortField == 'bizOrgName'">
<choose>
<when test="sortOrder == 'ascend'">
......
......@@ -1533,7 +1533,8 @@
FROM
p_plan_task
<where>
(finish_status = 2 OR finish_status = 3)
<!-- (finish_status = 2 OR finish_status = 3)-->
finish_num > 0
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = CURRENT_DATE ()
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
......@@ -1782,10 +1783,8 @@
s1.date
</select>
<select id="selectPatrolRecordPage" resultType="Map">
SELECT
*
FROM (
<select id="selectPatrolRecordPage" resultType="java.util.HashMap">
SELECT LEFT
( t.org_code, 18 ) AS bizOrgCode,
u.biz_org_name AS bizOrgName,
......@@ -1810,15 +1809,7 @@
</where>
GROUP BY
LEFT ( t.org_code, 18 ),t.id
) t
<where>
<if test="missStatus == 'miss'">
AND missPointCount > 0
</if>
<if test="missStatus == 'noMiss'">
AND missPointCount = 0
</if>
</where>
</select>
<select id="selectPatrolRecordTotal" resultType="long">
......@@ -1865,4 +1856,34 @@
GROUP BY
LEFT(t.org_code, 18)
</select>
<select id="getDoneNum" resultType="java.lang.Integer">
SELECT
COUNT(DISTINCT LEFT(p_plan_task.org_code, 18)) AS value
FROM
p_plan_task
<where>
finish_num > 0
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = #{date}
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
</select>
<select id="getDoneList" resultType="java.util.Map">
SELECT
COUNT( 1 ) AS num,
LEFT ( p_plan_task.org_code, 18 ) AS `code`
FROM
p_plan_task
<where>
finish_num > 0
AND DATE_FORMAT( check_date, '%Y-%m-%d' ) = #{date}
<if test="bizOrgCode != null and bizOrgCode != ''">
AND org_code LIKE CONCAT(#{bizOrgCode}, '%')
</if>
</where>
GROUP BY LEFT ( p_plan_task.org_code, 18 )
</select>
</mapper>
\ No newline at end of file
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