Sfoglia il codice sorgente

地图数据 首页权限白名单

wangzhe 9 mesi fa
parent
commit
df880e18d1

+ 1 - 0
ruoyi-admin/src/main/resources/application.yml

@@ -141,6 +141,7 @@ security:
     # 字典类型公共文件
     - /system/dict/data/type/*
     - /system/user/selectUserByUserName
+    - /zdsz/bigscreen/*
 
 # MyBatisPlus配置
 # https://baomidou.com/config/

+ 2 - 0
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/mapper/ZdszBigscreenMapper.java

@@ -44,6 +44,8 @@ public interface ZdszBigscreenMapper {
     List<Map> getCountPerson(ZdszBigscreenBo zdszBigscreenBo);
     int setConstructionMap(Map map);
     @MapKey("")
+    List<Map> civiNumMap(ZdszBigscreenBo zdszBigscreenBo);
+    @MapKey("")
     List<Map> getConstructionMap(ZdszBigscreenBo zdszBigscreenBo);
     int setConstructionNew(Map map);
     @MapKey("")

+ 121 - 35
ruoyi-zdsz/src/main/java/com/ruoyi/zdsz/service/impl/ZdszBigscreenServiceImpl.java

@@ -155,13 +155,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
 
     @Override
     public Map getProjectStatus(ZdszBigscreenBo zdszBigscreenBo){
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
         }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
             setProjectStatus(time);
         }
+        clearTime(zdszBigscreenBo);
         List<Map> list = bigscreenMapper.getProjectStatus(zdszBigscreenBo);
         int size = list.size();
         switch (size){
@@ -256,13 +256,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
     }
     @Override
     public Map getCountEngineering(ZdszBigscreenBo zdszBigscreenBo){
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
         }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
             setCountEngineering(time);
         }
+        clearTime(zdszBigscreenBo);
         List<Map> list = bigscreenMapper.getCountEngineering(zdszBigscreenBo);
         int size = list.size();
         switch (size){
@@ -314,13 +314,13 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
     }
     @Override
     public Map getCountPerson(ZdszBigscreenBo zdszBigscreenBo){
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
         }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
             setCountPerson(time);
         }
+        clearTime(zdszBigscreenBo);
         List<Map> list = bigscreenMapper.getCountPerson(zdszBigscreenBo);
         int size = list.size();
         switch (size){
@@ -369,33 +369,34 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
             String[] times = month.split("-");
             zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
             zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
-            List<Map> civiOldMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程 旧改
-            List<Map> civiMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程 新建
-            List<Map> gyMaps = bigscreenMapper.gyNumNew(zdszBigscreenBo); // 工业工程
-            List<Map> industryMaps = bigscreenMapper.industryNumNew(zdszBigscreenBo); // 市政工程
-            List<Map> touchMaps = bigscreenMapper.touchNumNew(zdszBigscreenBo); // 碰口工程
-            List<Map> infrastructureMaps = bigscreenMapper.infrastructureNumNew(zdszBigscreenBo); // 基建工程
-            List<Map> pipeMaps = bigscreenMapper.pipeNumNew(zdszBigscreenBo); // 顶管工程
-            initMaps = mapMergeMap(initMaps, civiMaps);
-            initMaps = mapMergeMap(initMaps, gyMaps);
-            initMaps = mapMergeMap(initMaps, industryMaps);
-            initMaps = mapMergeMap(initMaps, touchMaps);
-            initMaps = mapMergeMap(initMaps, infrastructureMaps);
-            initMaps = mapMergeMap(initMaps, pipeMaps);
-            initMaps = mapMergeMap(initMaps, civiOldMaps);
+//            List<Map> civiOldMaps = calculateMapData(bigscreenMapper.civiNumOld(zdszBigscreenBo)); // 民用工程 旧改
+//            List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumNew(zdszBigscreenBo)); // 民用工程 新建
+            List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumMap(zdszBigscreenBo)); // 民用工程 新建 旧改
+            List<Map> gyMaps = calculateMapData(bigscreenMapper.gyNumNew(zdszBigscreenBo)); // 工业工程
+            List<Map> industryMaps = calculateMapData(bigscreenMapper.industryNumNew(zdszBigscreenBo)); // 市政工程
+            List<Map> touchMaps = calculateMapData(bigscreenMapper.touchNumNew(zdszBigscreenBo)); // 碰口工程
+            List<Map> infrastructureMaps = calculateMapData(bigscreenMapper.infrastructureNumNew(zdszBigscreenBo)); // 基建工程
+            List<Map> pipeMaps = calculateMapData(bigscreenMapper.pipeNumNew(zdszBigscreenBo)); // 顶管工程
+            initMaps = mapMergeMapById(initMaps, civiMaps);
+            initMaps = mapMergeMapById(initMaps, gyMaps);
+            initMaps = mapMergeMapById(initMaps, industryMaps);
+            initMaps = mapMergeMapById(initMaps, touchMaps);
+            initMaps = mapMergeMapById(initMaps, infrastructureMaps);
+            initMaps = mapMergeMapById(initMaps, pipeMaps);
+//            initMaps = mapMergeMapById(initMaps, civiOldMaps);
         }
         map.put("json", mapToJson(initMaps)); // JSON数据
         bigscreenMapper.setConstructionMap(map);
     }
     @Override
     public Map getConstructionMap(ZdszBigscreenBo zdszBigscreenBo){
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
         }else if(time.equals(new SimpleDateFormat("yyyy-MM-dd").format(new Date()))){
             setConstructionMap(time);
         }
+        clearTime(zdszBigscreenBo);
         Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
         List<SysDictData> dictDataList = sysDictMap.get("district");
         List<Map> list = bigscreenMapper.getConstructionMap(zdszBigscreenBo);
@@ -468,30 +469,41 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
         Map map = new HashMap();
         map.put("time", time); // 创建时间
         List<Map> initMaps = new ArrayList<>();
+        List<Map> initMaps_civi = new ArrayList<>();
+        List<Map> initMaps_gy = new ArrayList<>();
+        List<Map> initMaps_industry = new ArrayList<>();
+        List<Map> initMaps_touch = new ArrayList<>();
+        List<Map> initMaps_infrastructure = new ArrayList<>();
+        List<Map> initMaps_pipe = new ArrayList<>();
         List<String> monthList = batchInitMonthList(null);
         for (String month: monthList) {
             String[] times = month.split("-");
             zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
             zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
-            List<Map> civiMaps = bigscreenMapper.civiNumNew(zdszBigscreenBo); // 民用工程
-            List<Map> gyMaps = bigscreenMapper.gyNumNew(zdszBigscreenBo); // 工业工程
-            List<Map> industryMaps = bigscreenMapper.industryNumNew(zdszBigscreenBo); // 市政工程
-            List<Map> touchMaps = bigscreenMapper.touchNumNew(zdszBigscreenBo); // 碰口工程
-            List<Map> infrastructureMaps = bigscreenMapper.infrastructureNumNew(zdszBigscreenBo); // 基建工程
-            List<Map> pipeMaps = bigscreenMapper.pipeNumNew(zdszBigscreenBo); // 顶管工程
-            initMaps = mapMergeMap(initMaps, civiMaps);
-            initMaps = mapMergeMap(initMaps, gyMaps);
-            initMaps = mapMergeMap(initMaps, industryMaps);
-            initMaps = mapMergeMap(initMaps, touchMaps);
-            initMaps = mapMergeMap(initMaps, infrastructureMaps);
-            initMaps = mapMergeMap(initMaps, pipeMaps);
-        }
+            List<Map> civiMaps = calculateMapData(bigscreenMapper.civiNumNew(zdszBigscreenBo)); // 民用工程
+            List<Map> gyMaps = calculateMapData(bigscreenMapper.gyNumNew(zdszBigscreenBo)); // 工业工程
+            List<Map> industryMaps = calculateMapData(bigscreenMapper.industryNumNew(zdszBigscreenBo)); // 市政工程
+            List<Map> touchMaps = calculateMapData(bigscreenMapper.touchNumNew(zdszBigscreenBo)); // 碰口工程
+            List<Map> infrastructureMaps = calculateMapData(bigscreenMapper.infrastructureNumNew(zdszBigscreenBo)); // 基建工程
+            List<Map> pipeMaps = calculateMapData(bigscreenMapper.pipeNumNew(zdszBigscreenBo)); // 顶管工程
+            initMaps_civi = mapMergeMapById(initMaps_civi, civiMaps);
+            initMaps_gy = mapMergeMapById(initMaps_gy, gyMaps);
+            initMaps_industry = mapMergeMapById(initMaps_industry, industryMaps);
+            initMaps_touch = mapMergeMapById(initMaps_touch, touchMaps);
+            initMaps_infrastructure = mapMergeMapById(initMaps_infrastructure, infrastructureMaps);
+            initMaps_pipe = mapMergeMapById(initMaps_pipe, pipeMaps);
+        }
+        initMaps = mapMergeMap(initMaps, initMaps_civi);
+        initMaps = mapMergeMap(initMaps, initMaps_gy);
+        initMaps = mapMergeMap(initMaps, initMaps_industry);
+        initMaps = mapMergeMap(initMaps, initMaps_touch);
+        initMaps = mapMergeMap(initMaps, initMaps_infrastructure);
+        initMaps = mapMergeMap(initMaps, initMaps_pipe);
         map.put("json", mapToJson(initMaps)); // JSON数据
         bigscreenMapper.setConstructionNew(map);
     }
     @Override
     public Map getConstructionNew(ZdszBigscreenBo zdszBigscreenBo){
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
@@ -500,6 +512,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
         }
         Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
         List<SysDictData> dictDataList = sysDictMap.get("district");
+        clearTime(zdszBigscreenBo);
         List<Map> list = bigscreenMapper.getConstructionNew(zdszBigscreenBo);
         int size = list.size();
         switch (size){
@@ -508,6 +521,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 List values = new ArrayList();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     values.add(0);
                 }
@@ -525,6 +541,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 JsonObject jsonObject = jsonValue.asObject();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     Object value = jsonObject.get(dictData.getDictValue());
                     values.add(value == null ? 0 : Long.valueOf(value.toString()));
@@ -539,6 +558,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 List values = new ArrayList();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     Long longValue = 0L;
                     for (int i = 0; i < list.size(); i++) {
@@ -578,16 +600,42 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
             String[] times = month.split("-");
             zdszBigscreenBo.setInfo("z_engineering_info_" + times[0] + "_" + times[1]); // z_engineering_info_2024_03
             zdszBigscreenBo.setNode("z_engineering_node_" + times[0] + "_" + times[1]); // z_engineering_node_2024_03
-            List<Map> maps = bigscreenMapper.civiNumOld(zdszBigscreenBo);
-            initMaps = mapMergeMap(initMaps, maps);
+            List<Map> maps = bigscreenMapper.civiNumOld(zdszBigscreenBo); // xz7 1768475728581869569 有重复 需过滤
+            initMaps = mapMergeMapById(initMaps, calculateMapData(maps));
         }
         map.put("json", mapToJson(initMaps)); // JSON数据
         bigscreenMapper.setConstructionOld(map);
     }
+    private List<Map> calculateMapData(List<Map> maps){
+        List<Map> mapList = new ArrayList<>();
+        for (Map<String, Object> source: maps) {
+            String sourceKey = source.get("key").toString();
+            String sourceValue = "" + source.get("value");
+            boolean isExist = false;
+            for (Map<String, String> map: mapList) {
+                String key = map.get("key");
+                String id = map.get("id");
+//                if(key != null ){
+                if(sourceKey.equals(key) && sourceValue.equals(id)){
+//                    Long value = Long.valueOf(""+map.get("value")) + 1L;
+//                    map.put("value", value.toString());
+                    isExist = true;
+                    break;
+                }
+            }
+            if(!isExist){
+                Map map = new HashMap();
+                map.put("id", sourceValue);
+                map.put("key", sourceKey);
+                map.put("value", "1");
+                mapList.add(map);
+            }
+        }
+        return mapList;
+    }
     @Override
     public Map getConstructionOld(ZdszBigscreenBo zdszBigscreenBo){
 //        batchInitData("2024-08-01");
-        clearTime(zdszBigscreenBo);
         String time = zdszBigscreenBo.getTime();
         if(time == null){
             zdszBigscreenBo.setTime(getPreviousDay());
@@ -596,6 +644,7 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
         }
         Map<String, List<SysDictData>> sysDictMap = RedisUtils.getCacheMap("sys_dict");
         List<SysDictData> dictDataList = sysDictMap.get("district");
+        clearTime(zdszBigscreenBo);
         List<Map> list = bigscreenMapper.getConstructionOld(zdszBigscreenBo);
         int size = list.size();
         switch (size){
@@ -604,6 +653,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 List values = new ArrayList();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     values.add(0);
                 }
@@ -621,6 +673,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 JsonObject jsonObject = jsonValue.asObject();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     Object value = jsonObject.get(dictData.getDictValue());
                     values.add(value == null ? 0 : Long.valueOf(value.toString()));
@@ -635,6 +690,9 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
                 List values = new ArrayList();
                 for (SysDictData dictData: dictDataList) {
 //                    names.add(dictData.getDictLabel());
+                    if(dictData.getRemark().equals("门市房")){
+                        continue;
+                    }
                     names.add(dictData.getRemark());
                     Long longValue = 0L;
                     for (int i = 0; i < list.size(); i++) {
@@ -715,6 +773,34 @@ public class ZdszBigscreenServiceImpl implements IZdszBigscreenService {
         }
         return destinations;
     }
+    List<Map> mapMergeMapById(List<Map> destinations, List<Map> maps){
+        for (int i = 0; i < maps.size(); i++) {
+            boolean isExist = false;
+            for (int j = 0; j < destinations.size(); j++) {
+                Map destination = destinations.get(j);
+                Map map = maps.get(i);
+                Object keyObj = map.get("key");
+                if(keyObj == null || destination.get("id") == null){
+                    continue;
+                }
+                if(keyObj.equals(destination.get("key"))){
+                    if(destination.get("id").equals(map.get("id"))){
+                        isExist = true;
+                        break;
+                    }else {
+                        isExist = true;
+                        Long value = Long.valueOf(destination.get("value").toString()) + Long.valueOf(map.get("value").toString());
+                        destination.put("value", value);
+                        break;
+                    }
+                }
+            }
+            if(!isExist){
+                destinations.add(maps.get(i));
+            }
+        }
+        return destinations;
+    }
 
     @Override
     public void bigscreenAutoQueryYesterdayData(String initTime){

+ 42 - 39
ruoyi-zdsz/src/main/resources/mapper/zdsz/ZdszBigscreenMapper.xml

@@ -37,11 +37,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_constructionProgress
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -83,11 +83,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_projectStatus
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -99,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         values (#{time}, #{civi}, #{gy}, #{industry}, #{touch}, #{infrastructure}, #{pipe})
     </insert>
     <select id="civiNumEng" resultType="java.lang.String">
-        select eng.id id from ${info} info left join ${node} node on info.eng_info_id = node.id left join z_engineering_civil eng on eng.id = node.civli_id where info.del_flag = 0 and date_format(info.update_time, '%Y-%m-%d') = #{time} group by eng.id
+        select area_id id from ${info} info left join ${node} node on info.eng_info_id = node.id left join z_engineering_civil eng on eng.id = node.civli_id where info.del_flag = 0 and date_format(info.update_time, '%Y-%m-%d') = #{time} and area_id is not null
     </select>
     <select id="gyNumEng" resultType="java.lang.String">
         select eng.id id from ${info} info left join ${node} node on info.eng_info_id = node.id left join z_engineering_gy eng on eng.id = node.civli_id where info.del_flag = 0 and date_format(info.update_time, '%Y-%m-%d') = #{time} group by eng.id
@@ -123,11 +123,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_count_engineering
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -148,7 +148,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         select count(user.user_id) from (select user_id from sys_user where date_format(login_date, '%Y-%m-%d') = #{time}) user left join sys_user_role user_role on user.user_id = user_role.user_id left join sys_role role on user_role.role_id = role.role_id where role.engin_type_list like '%市政工程%'
     </select>
     <select id="touchNumPer" resultType="java.lang.Long">
-        select count(user.user_id) from (select user_id from sys_user where date_format(login_date, '%Y-%m-%d') = #{time}) user left join sys_user_role user_role on user.user_id = user_role.user_id left join sys_role role on user_role.role_id = role.role_id where role.engin_type_list like '%碰口工程%'
+        select count(user.user_id) from (select user_id from sys_user where date_format(login_date, '%Y-%m-%d') = #{time}) user left join sys_user_role user_role on user.user_id = user_role.user_id left join sys_role role on user_role.role_id = role.role_id where role.engin_type_list like '%碰口作业%'
     </select>
     <select id="infrastructureNumPer" resultType="java.lang.Long">
         select count(user.user_id) from (select user_id from sys_user where date_format(login_date, '%Y-%m-%d') = #{time}) user left join sys_user_role user_role on user.user_id = user_role.user_id left join sys_role role on user_role.role_id = role.role_id where role.engin_type_list like '%基建工程%'
@@ -163,11 +163,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_count_person
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -178,6 +178,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         insert into z_bigscreen_construction_map (time, json)
         values (#{time}, #{json})
     </insert>
+    <select id="civiNumMap" resultType="java.util.Map">
+        select dict_value `key`, area_id `value` from ${info} info
+          left join ${node} node on info.eng_info_id = node.id
+          left join z_engineering_civil civi on node.civli_id = civi.id
+          left join sys_dict_data dict on dict.dict_value = civi.district
+        where info.del_flag = 0 and dict_type = 'district' and area_id is not null
+          and date_format(info.update_time, '%Y-%m-%d') = #{time}
+    </select>
     <select id="getConstructionMap" resultType="java.util.LinkedHashMap">
         <if test="time != null and time != ''">
             select * from z_bigscreen_construction_map where time = #{time}
@@ -185,11 +193,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_construction_map
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -201,52 +209,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         values (#{time}, #{json})
     </insert>
     <select id="civiNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, area_id `value` from ${info} info
          left join ${node} node on info.eng_info_id = node.id
          left join z_engineering_civil civi on node.civli_id = civi.id
          left join sys_dict_data dict on dict.dict_value = civi.district
-        where info.del_flag = 0 and dict_type = 'district' and civi.engin_type = 'new_built' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by civi.area_id
+        where info.del_flag = 0 and dict_type = 'district' and civi.engin_type = 'new_built' and area_id is not null
+          and date_format(info.update_time, '%Y-%m-%d') = #{time}
     </select>
     <select id="gyNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, eng.id `value` from ${info} info
             left join ${node} node on info.eng_info_id = node.id
             left join z_engineering_gy eng on node.civli_id = eng.id
             left join sys_dict_data dict on dict.dict_value = eng.district
         where info.del_flag = 0 and dict_type = 'district' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by dict_value
     </select>
     <select id="industryNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, eng.id `value` from ${info} info
             left join ${node} node on info.eng_info_id = node.id
             left join z_engineering_industry eng on node.civli_id = eng.id
             left join sys_dict_data dict on dict.dict_value = eng.district
         where info.del_flag = 0 and dict_type = 'district' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by dict_value
     </select>
     <select id="touchNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, eng.id `value` from ${info} info
             left join ${node} node on info.eng_info_id = node.id
             left join z_touch_operation_engineering eng on node.civli_id = eng.id
             left join sys_dict_data dict on dict.dict_value = eng.district
         where info.del_flag = 0 and dict_type = 'district' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by dict_value
     </select>
     <select id="infrastructureNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, eng.id `value` from ${info} info
             left join ${node} node on info.eng_info_id = node.id
             left join z_engineering_infrastructure eng on node.civli_id = eng.id
             left join sys_dict_data dict on dict.dict_value = eng.district
         where info.del_flag = 0 and dict_type = 'district' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by dict_value
     </select>
     <select id="pipeNumNew" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, eng.id `value` from ${info} info
             left join ${node} node on info.eng_info_id = node.id
             left join z_engineering_pipe_jacking eng on node.civli_id = eng.id
             left join sys_dict_data dict on dict.dict_value = eng.district
         where info.del_flag = 0 and dict_type = 'district' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by dict_value
     </select>
     <select id="getConstructionNew" resultType="java.util.LinkedHashMap">
         <if test="time != null and time != ''">
@@ -255,11 +258,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_construction_new
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>
@@ -271,12 +274,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         values (#{time}, #{json})
     </insert>
     <select id="civiNumOld" resultType="java.util.Map">
-        select dict_value `key`, count(dict_value) `value` from ${info} info
+        select dict_value `key`, house_id `value` from ${info} info
           left join ${node} node on info.eng_info_id = node.id
           left join z_engineering_civil civi on node.civli_id = civi.id
           left join sys_dict_data dict on dict.dict_value = civi.district
-        where info.del_flag = 0 and dict_type = 'district' and civi.engin_type = 'old_renovation' and date_format(info.update_time, '%Y-%m-%d') = #{time}
-        group by civi.house_id
+        where info.del_flag = 0 and dict_type = 'district' and civi.engin_type = 'old_renovation' and house_id is not null
+          and date_format(info.update_time, '%Y-%m-%d') = #{time}
     </select>
     <select id="civiNumOldOld" resultType="java.util.Map">
         select dict_value `key`, count(dict_value) `value` from (select dict_value from sys_dict_data dict left join z_engineering_civil civi on dict.dict_value = civi.district
@@ -313,11 +316,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="time == null or time == ''">
             select * from z_bigscreen_construction_old
             <where>
-                <if test="beginTime == null or beginTime == ''">
+                <if test="beginTime != null and beginTime != ''">
                     time >= #{beginTime}
                 </if>
-                <if test="endTime == null or endTime == ''">
-                    #{endTime} >= time
+                <if test="endTime != null and endTime != ''">
+                    and #{endTime} >= time
                 </if>
             </where>
         </if>