wwh vor 2 Jahren
Ursprung
Commit
47d5ebac76

+ 6 - 0
huimv-admin/src/main/java/com/huimv/admin/mapper/ProtDataMapper.java

@@ -21,11 +21,17 @@ import java.util.List;
 @Repository
 public interface ProtDataMapper extends BaseMapper<ProtData> {
     List<ProCountVo> listPh(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listPhYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
     List<ProCountVo> listCod(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listCodYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
     List<ProCountVo> listNh3n(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listNh3nYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
     List<ProCountVo> listTp(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listTpYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
     List<ProCountVo> listTn(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listTnYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
     List<ProCountVo> listFlow(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
+    List<ProCountVo> listFlowYear(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
 
     ProtData flowCount(@Param(Constants.WRAPPER) QueryWrapper<ProtData> queryWrapper);
 }

+ 6 - 2
huimv-admin/src/main/java/com/huimv/admin/service/impl/EnergyWarningInfoServiceImpl.java

@@ -35,7 +35,7 @@ public class EnergyWarningInfoServiceImpl extends ServiceImpl<EnergyWarningInfoM
         String farmId = paramsMap.get("farmId");
         String pageSize = paramsMap.get("pageSize");
         String pageNo = paramsMap.get("pageNo");
-       // String userIds = paramsMap.get("userIds");
+        String userIds = paramsMap.get("userIds");
 
         if (pageSize == null || pageSize == "") {
             pageSize = "10";
@@ -45,7 +45,11 @@ public class EnergyWarningInfoServiceImpl extends ServiceImpl<EnergyWarningInfoM
         }
 
         QueryWrapper<EnergyWarningInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("farm_id", farmId);
+        if ("1".equals(userIds)) {
+            queryWrapper.eq("farm_id", farmId).orderByDesc("date");
+        } else {
+            queryWrapper.eq("farm_id", farmId).like("user_ids",userIds).orderByDesc("date");
+        }
         Page<EnergyWarningInfo> page = new Page<>(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
         Page<EnergyWarningInfo> energyWarningInfoPage = energyWarningInfoMapper.selectPage(page, queryWrapper);
         return new Result(ResultCode.SUCCESS, energyWarningInfoPage);

+ 1 - 2
huimv-admin/src/main/java/com/huimv/admin/service/impl/EnergyWaterServiceImpl.java

@@ -101,14 +101,13 @@ public class EnergyWaterServiceImpl extends ServiceImpl<EnergyWaterMapper, Energ
         if ("4".equals(type)) {
             startTime = startTime + " 00:00:00";
             endTime = endTime + " 23:59:59";
-            queryWrapper.between("creata_date", startTime, endTime);
+            queryWrapper.between("create_date", startTime, endTime);
             energyWaterList = dataMapper.listDay3(queryWrapper);
         }
         //本年
         else if ("3".equals(type)) {
             DateTime dateTime = DateUtil.beginOfYear(new Date());
             queryWrapper.ge("create_date", dateTime);
-            List<EnergyWaterDataVo> energyWaterDataVos = dataMapper.listYear3(queryWrapper);
             energyWaterList = dataMapper.listYear3(queryWrapper);
         }
         //本月

+ 5 - 1
huimv-admin/src/main/java/com/huimv/admin/service/impl/EnvWarningInfoServiceImpl.java

@@ -42,7 +42,11 @@ public class EnvWarningInfoServiceImpl extends ServiceImpl<EnvWarningInfoMapper,
             pageNo = "1";
         }
         QueryWrapper<EnvWarningInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("farm_id", farmId).eq("user_ids",userIds);
+        if ("1".equals(userIds)) {
+            queryWrapper.eq("farm_id", farmId).orderByDesc("date");
+        } else {
+            queryWrapper.eq("farm_id", farmId).like("user_ids",userIds).orderByDesc("date");
+        }
         Page<EnvWarningInfo> page = new Page<>(Integer.parseInt(pageNo),Integer.parseInt(pageSize));
         Page<EnvWarningInfo> warningInfoPage = envWarningInfoMapper.selectPage(page, queryWrapper);
         return new Result(ResultCode.SUCCESS,warningInfoPage);

+ 6 - 1
huimv-admin/src/main/java/com/huimv/admin/service/impl/GasWarningInfoServiceImpl.java

@@ -32,6 +32,7 @@ public class GasWarningInfoServiceImpl extends ServiceImpl<GasWarningInfoMapper,
         String farmId = paramsMap.get("farmId");
         String pageSize = paramsMap.get("pageSize");
         String pageNo = paramsMap.get("pageNo");
+        String userIds = paramsMap.get("userIds");
         if (pageSize == null || pageSize == "") {
             pageSize = "10";
         }
@@ -39,7 +40,11 @@ public class GasWarningInfoServiceImpl extends ServiceImpl<GasWarningInfoMapper,
             pageNo = "1";
         }
         QueryWrapper<GasWarningInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("farm_id", farmId);
+        if ("1".equals(userIds)) {
+            queryWrapper.eq("farm_id", farmId).orderByDesc("date");
+        } else {
+            queryWrapper.eq("farm_id", farmId).orderByDesc("date").like("user_ids",userIds);
+        }
         Page<GasWarningInfo> page = new Page(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
         return new Result(ResultCode.SUCCESS,gasWarningInfoMapper.selectPage(page,queryWrapper));
     }

+ 18 - 18
huimv-admin/src/main/java/com/huimv/admin/service/impl/ProtDataServiceImpl.java

@@ -95,19 +95,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listPh(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listPhYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listPh(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listPhYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listPh(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listPhYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 
@@ -196,19 +196,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listCod(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listCodYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listCod(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listCodYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listCod(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listCodYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 
@@ -297,19 +297,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listNh3n(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listNh3nYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listNh3n(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listNh3nYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listNh3n(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listNh3nYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 
@@ -398,19 +398,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listTp(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listTpYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listTp(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listTpYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listTp(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listTpYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 
@@ -499,19 +499,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listTn(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listTnYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listTn(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listTnYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listTn(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listTnYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 
@@ -600,19 +600,19 @@ public class ProtDataServiceImpl extends ServiceImpl<ProtDataMapper, ProtData> i
                 // DateTime dateTime = DateUtil.beginOfYear(new Date());
                 queryWrapper.ge("create_date", i);
                 queryWrapper.eq("loction_type" ,1);
-                List<ProCountVo> protData1 = protDataMapper.listFlow(queryWrapper);
+                List<ProCountVo> protData1 = protDataMapper.listFlowYear(queryWrapper);
                 proCountDto.setInList(protData1);
 
                 QueryWrapper<ProtData> queryWrapper2 = new QueryWrapper<>();
                 queryWrapper2.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper2.eq("loction_type" ,2);
-                List<ProCountVo> protData2 = protDataMapper.listFlow(queryWrapper2);
+                List<ProCountVo> protData2 = protDataMapper.listFlowYear(queryWrapper2);
                 proCountDto.setDealList(protData2);
 
                 QueryWrapper<ProtData> queryWrapper3 = new QueryWrapper<>();
                 queryWrapper3.eq("farm_id",farmId).ge("create_date", i);
                 queryWrapper3.eq("loction_type" ,3);
-                List<ProCountVo> protData3 = protDataMapper.listFlow(queryWrapper3);
+                List<ProCountVo> protData3 = protDataMapper.listFlowYear(queryWrapper3);
                 proCountDto.setOutList(protData3);
 
 

+ 6 - 1
huimv-admin/src/main/java/com/huimv/admin/service/impl/ProtWarningInfoServiceImpl.java

@@ -34,6 +34,7 @@ public class ProtWarningInfoServiceImpl extends ServiceImpl<ProtWarningInfoMappe
         String farmId = paramsMap.get("farmId");
         String pageSize = paramsMap.get("pageSize");
         String pageNo = paramsMap.get("pageNo");
+        String userIds = paramsMap.get("userIds");
         if (pageSize==""||pageSize==null) {
             pageSize = "10";
         }
@@ -41,7 +42,11 @@ public class ProtWarningInfoServiceImpl extends ServiceImpl<ProtWarningInfoMappe
             pageNo = "1";
         }
         QueryWrapper<ProtWarningInfo> queryWrapper = new QueryWrapper<>();
-        queryWrapper.eq("farm_id", farmId).orderByDesc("date");
+        if ("1".equals(userIds)) {
+            queryWrapper.eq("farm_id",farmId).orderByDesc("date");
+        } else {
+            queryWrapper.eq("farm_id", farmId).orderByDesc("date").like("user_ids", userIds);
+        }
         Page<ProtWarningInfo> page = new Page(Integer.parseInt(pageNo), Integer.parseInt(pageSize));
         return new Result(ResultCode.SUCCESS,protWarningInfoMapper.selectPage(page,queryWrapper));
     }

+ 38 - 0
huimv-admin/src/main/resources/com/huimv/admin/mapper/ProtDataMapper.xml

@@ -25,36 +25,74 @@
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listPhYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(ph),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
     <select id="listCod" resultType="com.huimv.admin.entity.vo.ProCountVo">
         select Convert((IFNULL(AVG(cod),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
         ${ew.customSqlSegment}
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listCodYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(cod),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
     <select id="listNh3n" resultType="com.huimv.admin.entity.vo.ProCountVo">
         select Convert((IFNULL(AVG(NH3N),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
         ${ew.customSqlSegment}
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listNh3nYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(NH3N),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
     <select id="listTp" resultType="com.huimv.admin.entity.vo.ProCountVo">
         select Convert((IFNULL(AVG(TP),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
         ${ew.customSqlSegment}
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listTpYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(TP),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
     <select id="listTn" resultType="com.huimv.admin.entity.vo.ProCountVo">
         select Convert((IFNULL(AVG(TN),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
         ${ew.customSqlSegment}
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listTnYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(TN),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
+
     <select id="listFlow" resultType="com.huimv.admin.entity.vo.ProCountVo">
         select Convert((IFNULL(AVG(FLOW),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
         ${ew.customSqlSegment}
         group BY DATE_FORMAT(create_date,'%Y-%m-%d')
         ORDER BY create_date ASC
     </select>
+    <select id="listFlowYear" resultType="com.huimv.admin.entity.vo.ProCountVo">
+        select Convert((IFNULL(AVG(FLOW),'0')),DECIMAL(10,2)) 'value',create_date,loction_type from prot_data
+        ${ew.customSqlSegment}
+        group BY DATE_FORMAT(create_date,'%Y-%m')
+        ORDER BY create_date ASC
+    </select>
+
 
     <!--大屏-->
     <select id="flowCount" resultType="com.huimv.admin.entity.ProtData">