Browse Source

设备查询

lin 4 years ago
parent
commit
6f9ed09293

+ 35 - 85
smart-city-platform/src/main/java/com/bz/smart_city/controller/DeviceController.java

@@ -44,28 +44,24 @@ public class DeviceController {
     @ApiOperation(value = "获取设备分页")
     public AjaxMessage<Pagination<DeviceDto>> devicePageList(
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
+            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
+            @ApiParam(value = "设备类型id", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
+            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
+            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
+            @ApiParam(value = "小区id", required = false) @RequestParam(required = false) Integer community,
             @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId,
             @ApiParam(value = "设备编号", required = false) @RequestParam(required = false) String deviceNo,
-            @ApiParam(value = "状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
-            @ApiParam(value = "厂商id", required = false) @RequestParam(required = false) Integer manufacturerId,
-            @ApiParam(value = "系列", required = false) @RequestParam(required = false) String equipmentType,
-            @ApiParam(value = "型号", required = false) @RequestParam(required = false) String model,
-            @ApiParam(value = "是否标记 0:未标记 1:已标记", required = false) @RequestParam(required = false) Integer isTag,
             @ApiParam(value = "楼层", required = false) @RequestParam(required = false) Integer floor,
             @ApiParam(value = "位置描述", required = false) @RequestParam(required = false) String locDesc,
-            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
-            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
-            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
-            @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer community,
+            @ApiParam(value = "集中器id", required = false) @RequestParam(required = false) Integer concentratorId,
             @ApiParam(value = "集中器编号", required = false) @RequestParam(required = false) String concentratorNo,
+            @ApiParam(value = "采集器id", required = false) @RequestParam(required = false) Integer collectorId,
             @ApiParam(value = "采集器编号", required = false) @RequestParam(required = false) String collectorNo,
             @ApiParam(value = "通道号id", required = false) @RequestParam(required = false) Integer channelNumberId,
             @ApiParam(value = "故障类型", required = false) @RequestParam(required = false) String errorType,
-            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
             @ApiParam(value = "连续故障天数", required = false) @RequestParam(required = false) Integer days,
-            @ApiParam(value = "连续故障开始天数", required = false) @RequestParam(required = false) Integer startDays,
-            @ApiParam(value = "连续故障结束天数", required = false) @RequestParam(required = false) Integer endDays,
-            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "设备状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
             @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
             @ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
             @ApiParam(value = "下发状态 0:未下发 1:已下发", required = false) @RequestParam(required = false) Integer issueStatus,
@@ -77,8 +73,8 @@ public class DeviceController {
             @ApiParam(value = "页数,非必传,默认第一页", required = false, defaultValue = "1") @RequestParam(required = false, defaultValue = "1") int pageNum,
             @ApiParam(value = "条数,非必传,默认15条", required = false, defaultValue = "15") @RequestParam(required = false, defaultValue = "15") int pageSize
     ) {
-        Pagination<DeviceDto> pageInfo = deviceService.getList(sysId, buildingId, StringUtils.trim(deviceNo), status, manufacturerId, StringUtils.trim(equipmentType), StringUtils.trim(model), isTag,
-                floor, StringUtils.trim(locDesc), province, city, region, community, concentratorNo, collectorNo, channelNumberId, errorType, customerId, days, startDays,endDays,
+        Pagination<DeviceDto> pageInfo = deviceService.getList(sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+                province, city, region, community, concentratorId,concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId, days,
                 deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading, sortColumn, sortOrder, pageNum, pageSize);
         return new AjaxMessage<>(ResultStatus.OK, pageInfo);
     }
@@ -101,69 +97,25 @@ public class DeviceController {
     @ApiOperation(value = "导出设备列表excel")
     public void getDeviceListExcel(
             @ApiParam(value = "别名", required = false) @RequestParam(required = false) String alias,
-            @ApiParam(value = "系统id", required = true) @RequestParam(required = true) Integer sysId,
-            @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId,
-            @ApiParam(value = "设备编号", required = false) @RequestParam(required = false) String deviceNo,
-            @ApiParam(value = "状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
-            @ApiParam(value = "厂商id", required = false) @RequestParam(required = false) Integer manufacturerId,
-            @ApiParam(value = "系列", required = false) @RequestParam(required = false) String equipmentType,
-            @ApiParam(value = "型号", required = false) @RequestParam(required = false) String model,
-            @ApiParam(value = "是否标记 0:未标记 1:已标记", required = false) @RequestParam(required = false) Integer isTag,
-            @ApiParam(value = "楼层", required = false) @RequestParam(required = false) Integer floor,
-            @ApiParam(value = "位置描述", required = false) @RequestParam(required = false) String locDesc,
+            @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
+            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
+            @ApiParam(value = "设备类型id", required = false) @RequestParam(required = false) Integer deviceTypeId,
             @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
             @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
             @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
-            @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer community,
-            @ApiParam(value = "集中器编号", required = false) @RequestParam(required = false) String concentratorNo,
-            @ApiParam(value = "采集器编号", required = false) @RequestParam(required = false) String collectorNo,
-            @ApiParam(value = "故障类型", required = false) @RequestParam(required = false) String errorType,
-            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
-            @ApiParam(value = "连续故障天数", required = false) @RequestParam(required = false) Integer days,
-            @ApiParam(value = "连续故障开始天数", required = false) @RequestParam(required = false) Integer startDays,
-            @ApiParam(value = "连续故障结束天数", required = false) @RequestParam(required = false) Integer endDays,
-            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
-            @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
-            @ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
-            @ApiParam(value = "下发状态 0:未下发 1:已下发", required = false) @RequestParam(required = false) Integer issueStatus,
-            @ApiParam(value = "同步状态 0:未同步 1:已同步", required = false) @RequestParam(required = false) Integer syncStatus,
-            @ApiParam(value = "开始当前读数", required = false) @RequestParam(required = false) Double startReading,
-            @ApiParam(value = "结束当前读数", required = false) @RequestParam(required = false) Double endReading,
-            @ApiParam(value = "排序参数,对应列表字段", required = false) @RequestParam(required = false,defaultValue = "sd.date_create") String sortColumn,
-            @ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false,defaultValue = "DESC") String sortOrder,
-            HttpServletResponse httpServletResponse
-    ) {
-        deviceService.getDeviceListExcel(alias,sysId, buildingId, StringUtils.trim(deviceNo), status, manufacturerId, StringUtils.trim(equipmentType), StringUtils.trim(model), isTag,
-                floor, StringUtils.trim(locDesc), province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays, endDays,
-                deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading, sortColumn, sortOrder, httpServletResponse);
-
-    }
-
-    @GetMapping("/v2/getDeviceListExcel")
-    @ApiOperation(value = "导出设备列表excel")
-    public void getDeviceListExcelV2(
-            @ApiParam(value = "系统id", required = true) @RequestParam(required = true) Integer sysId,
+            @ApiParam(value = "小区id", required = false) @RequestParam(required = false) Integer community,
             @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId,
             @ApiParam(value = "设备编号", required = false) @RequestParam(required = false) String deviceNo,
-            @ApiParam(value = "状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
-            @ApiParam(value = "厂商id", required = false) @RequestParam(required = false) Integer manufacturerId,
-            @ApiParam(value = "系列", required = false) @RequestParam(required = false) String equipmentType,
-            @ApiParam(value = "型号", required = false) @RequestParam(required = false) String model,
-            @ApiParam(value = "是否标记 0:未标记 1:已标记", required = false) @RequestParam(required = false) Integer isTag,
             @ApiParam(value = "楼层", required = false) @RequestParam(required = false) Integer floor,
             @ApiParam(value = "位置描述", required = false) @RequestParam(required = false) String locDesc,
-            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
-            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
-            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
-            @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer community,
+            @ApiParam(value = "集中器id", required = false) @RequestParam(required = false) Integer concentratorId,
             @ApiParam(value = "集中器编号", required = false) @RequestParam(required = false) String concentratorNo,
+            @ApiParam(value = "采集器id", required = false) @RequestParam(required = false) Integer collectorId,
             @ApiParam(value = "采集器编号", required = false) @RequestParam(required = false) String collectorNo,
+            @ApiParam(value = "通道号id", required = false) @RequestParam(required = false) Integer channelNumberId,
             @ApiParam(value = "故障类型", required = false) @RequestParam(required = false) String errorType,
-            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
             @ApiParam(value = "连续故障天数", required = false) @RequestParam(required = false) Integer days,
-            @ApiParam(value = "连续故障开始天数", required = false) @RequestParam(required = false) Integer startDays,
-            @ApiParam(value = "连续故障结束天数", required = false) @RequestParam(required = false) Integer endDays,
-            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "设备状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
             @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
             @ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
             @ApiParam(value = "下发状态 0:未下发 1:已下发", required = false) @RequestParam(required = false) Integer issueStatus,
@@ -174,12 +126,13 @@ public class DeviceController {
             @ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false,defaultValue = "DESC") String sortOrder,
             HttpServletResponse httpServletResponse
     ) {
-        deviceService.getDeviceListExcelV2(sysId, buildingId, StringUtils.trim(deviceNo), status, manufacturerId, StringUtils.trim(equipmentType), StringUtils.trim(model), isTag,
-                floor, StringUtils.trim(locDesc), province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays, endDays,
+        deviceService.getDeviceListExcel(alias,sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+                province, city, region, community,concentratorId, concentratorNo, collectorId,collectorNo,channelNumberId, errorType, customerId, days,
                 deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading, sortColumn, sortOrder, httpServletResponse);
 
     }
 
+
     @GetMapping("/exportDeviceListAsXML")
     @ApiOperation(value = "导出设备列表XML")
     public void exportDeviceListAsXML(
@@ -220,27 +173,24 @@ public class DeviceController {
     @ApiOperation(value = "获取设备数量区域列表")
     public AjaxMessage<List<BuildingSelectDto>> deviceAreaList(
             @ApiParam(value = "系统id", required = false) @RequestParam(required = false) Integer sysId,
+            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
+            @ApiParam(value = "设备类型id", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
+            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
+            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
+            @ApiParam(value = "小区id", required = false) @RequestParam(required = false) Integer community,
             @ApiParam(value = "建筑id", required = false) @RequestParam(required = false) Integer buildingId,
             @ApiParam(value = "设备编号", required = false) @RequestParam(required = false) String deviceNo,
-            @ApiParam(value = "状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
-            @ApiParam(value = "厂商id", required = false) @RequestParam(required = false) Integer manufacturerId,
-            @ApiParam(value = "系列", required = false) @RequestParam(required = false) String equipmentType,
-            @ApiParam(value = "型号", required = false) @RequestParam(required = false) String model,
-            @ApiParam(value = "是否标记 0:未标记 1:已标记", required = false) @RequestParam(required = false) Integer isTag,
             @ApiParam(value = "楼层", required = false) @RequestParam(required = false) Integer floor,
             @ApiParam(value = "位置描述", required = false) @RequestParam(required = false) String locDesc,
-            @ApiParam(value = "省", required = false) @RequestParam(required = false) Integer province,
-            @ApiParam(value = "市", required = false) @RequestParam(required = false) Integer city,
-            @ApiParam(value = "区", required = false) @RequestParam(required = false) Integer region,
-            @ApiParam(value = "小区", required = false) @RequestParam(required = false) Integer community,
+            @ApiParam(value = "集中器id", required = false) @RequestParam(required = false) Integer concentratorId,
             @ApiParam(value = "集中器编号", required = false) @RequestParam(required = false) String concentratorNo,
+            @ApiParam(value = "采集器id", required = false) @RequestParam(required = false) Integer collectorId,
             @ApiParam(value = "采集器编号", required = false) @RequestParam(required = false) String collectorNo,
+            @ApiParam(value = "通道号id", required = false) @RequestParam(required = false) Integer channelNumberId,
             @ApiParam(value = "故障类型", required = false) @RequestParam(required = false) String errorType,
-            @ApiParam(value = "客户id", required = false) @RequestParam(required = false) Integer customerId,
             @ApiParam(value = "连续故障天数", required = false) @RequestParam(required = false) Integer days,
-            @ApiParam(value = "连续故障开始天数", required = false) @RequestParam(required = false) Integer startDays,
-            @ApiParam(value = "连续故障结束天数", required = false) @RequestParam(required = false) Integer endDays,
-            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "设备状态  1:正常 2:故障 3:无 4: 预警 5:未启用", required = false) @RequestParam(required = false) Integer status,
             @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
             @ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
             @ApiParam(value = "下发状态 0:未下发 1:已下发", required = false) @RequestParam(required = false) Integer issueStatus,
@@ -248,9 +198,9 @@ public class DeviceController {
             @ApiParam(value = "开始当前读数", required = false) @RequestParam(required = false) Double startReading,
             @ApiParam(value = "结束当前读数", required = false) @RequestParam(required = false) Double endReading
     ) {
-        List<BuildingSelectDto> list = buildingService.deviceAreaList(sysId, buildingId, deviceNo, status, manufacturerId, equipmentType, model, isTag,
-                floor, locDesc, province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays,endDays,deviceTypeId,
-                valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading);
+        List<BuildingSelectDto> list = buildingService.deviceAreaList(sysId, buildingId, StringUtils.trim(deviceNo), status, floor, StringUtils.trim(locDesc),
+                province, city, region, community, concentratorId,concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId, days,
+                deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus, startReading, endReading);
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
 

+ 4 - 6
smart-city-platform/src/main/java/com/bz/smart_city/controller/water/WaterMeterReadController.java

@@ -90,11 +90,10 @@ public class WaterMeterReadController {
 		// 1,获取用户的站点信息,进行数据权限控制
 		LoginUser loginUser = UserUtil.getCurrentUser();
 
-		List<ProgramItem> programItems = loginUser.getDataPermissionMap().get(loginUser.getSiteId());
 
 		CommonQueryCondition condition = new CommonQueryCondition();
 		condition.setSiteId(loginUser.getSiteId());
-		condition.setProgramItems(programItems);
+		//condition.setProgramItems(programItems);
 //        condition.setSites(loginUser.getSiteList());
 		// 2,根据入参构造查询条件
 		condition.setStartDate(startDate);
@@ -1070,11 +1069,11 @@ public class WaterMeterReadController {
 		// 1,获取用户的站点信息,进行数据权限控制
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        List<ProgramItem> programItems = loginUser.getDataPermissionMap().get(loginUser.getSiteId());
+
 
         CommonQueryCondition condition = new CommonQueryCondition();
         condition.setSiteId(loginUser.getSiteId());
-        condition.setProgramItems(programItems);
+        //condition.setProgramItems(programItems);
         // 2,根据入参构造查询条件
         condition.setStartDate(startDate);
         condition.setEndDate(endDate);
@@ -1123,11 +1122,10 @@ public class WaterMeterReadController {
         // 1,获取用户的站点信息,进行数据权限控制
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        List<ProgramItem> programItems = loginUser.getDataPermissionMap().get(loginUser.getSiteId());
 
         CommonQueryCondition condition = new CommonQueryCondition();
         condition.setSiteId(loginUser.getSiteId());
-        condition.setProgramItems(programItems);
+        //condition.setProgramItems(programItems);
         // 2,根据入参构造查询条件
         condition.setStartDate(startDate);
         condition.setEndDate(endDate);

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/dao/BuildingMapper.java

@@ -73,7 +73,7 @@ public interface BuildingMapper {
 
     List<Building> findByIds(@Param("ids") List<Integer> ids);
 
-    List<BuildingSelectInfoDto> deviceCountAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("manufacturerId") Integer manufacturerId, @Param("equipmentType") String equipmentType, @Param("model") String model, @Param("isTag") Integer isTag, @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorNo") String concentratorNo, @Param("collectorNo") String collectorNo, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days, @Param("startDays") Integer startDays, @Param("endDays") Integer endDays, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus, @Param("registerStatus") Integer registerStatus, @Param("issueStatus") Integer issueStatus, @Param("syncStatus") Integer syncStatus, @Param("startReading") Double startReading, @Param("endReading") Double endReading);
+    List<BuildingSelectInfoDto> deviceCountAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorId") Integer concentratorId, @Param("concentratorNo") String concentratorNo, @Param("collectorId") Integer collectorId, @Param("collectorNo") String collectorNo, @Param("channelNumberId") Integer channelNumberId, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus, @Param("registerStatus") Integer registerStatus, @Param("issueStatus") Integer issueStatus, @Param("syncStatus") Integer syncStatus, @Param("startReading") Double startReading, @Param("endReading") Double endReading);
 
     List<BuildingSelectInfoDto> abnormalAreaBuildingList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("floor") Integer floor, @Param("measuringId") Integer measuringId, @Param("deviceId") Long deviceId, @Param("deviceNo") String deviceNo, @Param("location") String location, @Param("alarmCategory") Integer alarmCategory, @Param("handleStatus") Integer handleStatus, @Param("alarmTypeId") Integer alarmTypeId, @Param("equipmentId") Integer equipmentId, @Param("manufacturerId") Integer manufacturerId, @Param("customerId") Integer customerId, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("communityId") Integer communityId, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
 

+ 5 - 5
smart-city-platform/src/main/java/com/bz/smart_city/dao/DeviceMapper.java

@@ -28,11 +28,11 @@ public interface DeviceMapper {
 
     //查询设备列表
     List<DeviceDto> getList(@Param("sysId") Integer sysId, @Param("buildingId") Integer buildingId, @Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems,
-                            @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("manufacturerId") Integer manufacturerId, @Param("equipmentType") String equipmentType,
-                            @Param("model") String model, @Param("isTag") Integer isTag, @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province,
-                            @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorNo") String concentratorNo,
-                            @Param("collectorNo") String collectorNo, @Param("channelNumberId") Integer channelNumberId, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days,
-                            @Param("startDays") Integer startDays, @Param("endDays") Integer endDays, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus,
+                            @Param("deviceNo") String deviceNo, @Param("status") Integer status,
+                            @Param("floor") Integer floor, @Param("locDesc") String locDesc, @Param("province") Integer province,
+                            @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("concentratorId") Integer concentratorId, @Param("concentratorNo") String concentratorNo,
+                            @Param("collectorId") Integer collectorId, @Param("collectorNo") String collectorNo, @Param("channelNumberId") Integer channelNumberId, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("days") Integer days,
+                            @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus,
                             @Param("registerStatus") Integer registerStatus, @Param("issueStatus") Integer issueStatus, @Param("syncStatus") Integer syncStatus, @Param("startReading") Double startReading, @Param("endReading") Double endReading, @Param("sortColumn") String sortColumn, @Param("sortOrder") String sortOrder);
 
     //按设备编号查询

+ 1 - 1
smart-city-platform/src/main/java/com/bz/smart_city/service/BuildingService.java

@@ -83,7 +83,7 @@ public interface BuildingService{
 
     public List<BuildingSelectDto> areaList(List<BuildingSelectInfoDto> buildingList);
 
-    List<BuildingSelectDto> deviceAreaList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading);
+    List<BuildingSelectDto> deviceAreaList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, Integer isTag, Integer floor, Integer province, Integer city, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Double startReading, Double endReading);
 
     List<BuildingSelectDto> abnormalAreaBuildingList(Integer sysId, Integer buildingId, Integer floor, Integer measuringId, Long deviceId, String deviceNo, String location, Integer alarmCategory, Integer handleStatus, Integer alarmTypeId, Integer equipmentId, Integer manufacturerId, Integer customerId, Integer province, Integer city, Integer region, Integer communityId, LocalDateTime startDate, LocalDateTime endDate);
 

+ 10 - 9
smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceService.java

@@ -37,19 +37,20 @@ public interface DeviceService{
 
     DeviceDto getDeviceLastReceiveTime(Long deviceId);
 
-    Pagination<DeviceDto> getList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor,
-                                  String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, Integer channelNumberId, String errorType,
-                                  Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize);
+    Pagination<DeviceDto> getList(
+            Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+            String locDesc, Integer province, Integer city, Integer region, Integer community,
+            Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,
+            Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId,
+            Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus,
+            Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize);
 
     List<DeviceDto> getWaterMeterListByDeviceNo(String deviceNo,String waterMeterNo);
 
-    void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor,
-                            String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, String errorType,
-                            Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
+    void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+                            String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType,
+                            Integer customerId, Integer days,  Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
 
-    void getDeviceListExcelV2(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor,
-                            String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, String errorType,
-                            Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
 
 
     void exportDeviceListAsXML(Integer sysId,

+ 9 - 2
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/BuildingServiceImpl.java

@@ -926,10 +926,17 @@ public class BuildingServiceImpl implements BuildingService {
     }
 
     @Override
-    public List<BuildingSelectDto> deviceAreaList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer communityId, String concentratorNo, String collectorNo, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading) {
+    public List<BuildingSelectDto> deviceAreaList(
+            Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor,
+            String locDesc, Integer province, Integer city, Integer region, Integer community,
+            Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,
+            Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId,
+            Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus,
+            Double startReading, Double endReading
+    ) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         //查询用户数据项下的建筑列表
-        List<BuildingSelectInfoDto> buildingList = buildingMapper.deviceCountAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), sysId, buildingId, deviceNo, status, manufacturerId, equipmentType, model, isTag, floor, locDesc, province, city, region, communityId, concentratorNo, collectorNo, errorType, customerId, days, startDays, endDays,deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus,startReading,endReading);
+        List<BuildingSelectInfoDto> buildingList = buildingMapper.deviceCountAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), sysId, buildingId, deviceNo, status,  floor, locDesc, province, city, region, community,concentratorId, concentratorNo,collectorId, collectorNo,channelNumberId, errorType, customerId, days,deviceTypeId,valveStatus,registerStatus,issueStatus,syncStatus,startReading,endReading);
 
         return this.areaList(buildingList);
     }

+ 9 - 169
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/DeviceServiceImpl.java

@@ -176,13 +176,13 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public Pagination<DeviceDto> getList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize) {
+    public Pagination<DeviceDto> getList(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo, Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         PageHelper.startPage(pageNum, pageSize);
-        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status, manufacturerId,
-                equipmentType, model, isTag, floor, locDesc, province, city, region, community, concentratorNo, collectorNo, channelNumberId, errorType, customerId,
-                days, startDays, endDays,deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus,startReading,endReading, sortColumn, sortOrder);
+        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
+                floor, locDesc, province, city, region, community,concentratorId, concentratorNo,collectorId, collectorNo, channelNumberId, errorType, customerId,
+                days,deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus,startReading,endReading, sortColumn, sortOrder);
         return new Pagination<>(list);
     }
 
@@ -193,180 +193,20 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
+    public void getDeviceListExcel(String alias, Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, Integer concentratorId, String concentratorNo, Integer collectorId, String collectorNo,Integer channelNumberId, String errorType, Integer customerId, Integer days, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
         LoginUser loginUser = UserUtil.getCurrentUser();
 
-        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status, manufacturerId,
-                equipmentType, model, isTag, floor, locDesc, province, city, region, community, concentratorNo, collectorNo, null, errorType, customerId,
-                days, startDays, endDays, deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus, startReading, endReading, sortColumn, sortOrder);
+        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status,
+                floor, locDesc, province, city, region, community, concentratorId, concentratorNo, collectorId, collectorNo, null, errorType, customerId,
+                days, deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus, startReading, endReading, sortColumn, sortOrder);
         String title = "设备列表";
 
 
         generalDownload.export(title,alias,list,httpServletResponse);
-        //判断是否是水表场景
-        /*WMeterType wMeterType = wMeterTypeMapper.getChannelIdAndLevel(sysId, 2);
-        Channel channel = channelMapper.findById(sysId);
-        if (wMeterType != null || sysId == -99) {
-            if(StringUtils.equals("photoelectricMeter",channel.getChannelCode())){
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String[] rowsName = new String[]{"序号", "水表电子号", "设备型号", "客户", "设备状态", "集中器编码", "采集器编码", "下发状态", "当前读数", "建筑", "安装地址", "阀门控制", "最后一次更新时间","出厂时间","安装时间","验收时间"};
-                List<Object[]> dataList = newArrayList();
-                Object[] objs = null;
-                for (int i = 0; i < list.size(); i++) {
-                    DeviceDto deviceDto = list.get(i);
-                    objs = new Object[rowsName.length];
-                    objs[0] = i;
-                    objs[1] = deviceDto.getWaterMeterNo();
-                    objs[2] = deviceDto.getManufacturerName()+"/"+deviceDto.getEquipmentType()+"/"+deviceDto.getManufacturerName();
-                    objs[3] = deviceDto.getCustomerName();
-                    objs[4] = this.getDeviceStatusName(deviceDto.getDeviceStatus());
-                    objs[5] = deviceDto.getConcentratorName();
-                    objs[6] = deviceDto.getCollectorName();
-                    objs[7] = this.getIssueStatusName(deviceDto.getIssueStatus());
-                    objs[8] = deviceDto.getMeterReading();
-                    objs[9] = deviceDto.getBuildingName();
-                    objs[10] = deviceDto.getLocDesc();
-                    objs[11] = this.getValveStatusName(deviceDto.getIsValve(),deviceDto.getValveStatus());
-                    objs[12] = deviceDto.getLastReceiveTime()!=null?deviceDto.getLastReceiveTime().format(df):null;
-                    objs[13] = deviceDto.getPlanTime()!=null?deviceDto.getPlanTime().format(df):null;
-                    objs[14] = deviceDto.getInstallTime()!=null?deviceDto.getInstallTime().format(df):null;
-                    objs[15] = deviceDto.getAcceptTime()!=null?deviceDto.getAcceptTime().format(df):null;
-                    dataList.add(objs);
-                }
-                ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-                try {
-                    excelUtil.export(httpServletResponse);
-                } catch (Exception e) {
-                    throw new ServiceException(-900, "导出异常");
-                }
-            }else {
-                DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-                String[] rowsName = new String[]{"序号", "设备状态", "设备编号", "水表档案编号", "水表电子号", "集中器编码", "采集器编码", "设备型号", "客户", "小区", "建筑", "安装地址", "告警类型", "连续故障天数", "当前读数", "最后上报时间","阀门控制","出厂时间","创建时间","验收时间"};
-                List<Object[]> dataList = newArrayList();
-                Object[] objs = null;
-                for (int i = 0; i < list.size(); i++) {
-                    DeviceDto deviceDto = list.get(i);
-                    objs = new Object[rowsName.length];
-                    objs[0] = i;
-                    objs[1] = this.getDeviceStatusName(deviceDto.getDeviceStatus());
-                    objs[2] = deviceDto.getDeviceNo();
-                    objs[3] = deviceDto.getWaterMeterFileNo();
-                    objs[4] = deviceDto.getWaterMeterNo();
-                    objs[5] = deviceDto.getConcentratorName();
-                    objs[6] = deviceDto.getCollectorName();
-                    objs[7] = deviceDto.getManufacturerName()+"/"+deviceDto.getEquipmentType()+"/"+deviceDto.getManufacturerName();
-                    objs[8] = deviceDto.getCustomerName();
-                    objs[9] = deviceDto.getCommunityName();
-                    objs[10] = deviceDto.getBuildingName();
-                    objs[11] = deviceDto.getLocDesc();
-                    objs[12] = deviceDto.getLastErrorType();
-                    objs[13] = deviceDto.getDays();
-                    objs[14] = deviceDto.getMeterReading();
-                    objs[15] = deviceDto.getLastReceiveTime()!=null?deviceDto.getLastReceiveTime().format(df):null;
-                    objs[16] = this.getValveStatusName(deviceDto.getIsValve(),deviceDto.getValveStatus());
-                    objs[17] = deviceDto.getPlanTime()!=null?deviceDto.getPlanTime().format(df):null;
-                    objs[18] = deviceDto.getInstallTime()!=null?deviceDto.getInstallTime().format(df):null;
-                    objs[19] = deviceDto.getAcceptTime()!=null?deviceDto.getAcceptTime().format(df):null;
-                    dataList.add(objs);
-                }
-                ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-                try {
-                    excelUtil.export(httpServletResponse);
-                } catch (Exception e) {
-                    throw new ServiceException(-900, "导出异常");
-                }
-            }
-        } else {
-            String[] rowsName = new String[]{"序号", "状态", "编号", "系列", "型号", "厂商", "所属建筑", "楼层", "位置"};
-            List<Object[]> dataList = newArrayList();
-            Object[] objs = null;
-            for (int i = 0; i < list.size(); i++) {
-                DeviceDto deviceDto = list.get(i);
-                objs = new Object[rowsName.length];
-                objs[0] = i;
-                objs[1] = this.getDeviceStatusName(deviceDto.getDeviceStatus());
-                objs[2] = deviceDto.getDeviceNo();
-                objs[3] = deviceDto.getEquipmentType();
-                objs[4] = deviceDto.getModel();
-                objs[5] = deviceDto.getManufacturerName();
-                objs[6] = deviceDto.getBuildingName();
-                objs[7] = deviceDto.getFloor();
-                objs[8] = deviceDto.getLocDesc();
-                dataList.add(objs);
-            }
-            ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-            try {
-                excelUtil.export(httpServletResponse);
-            } catch (Exception e) {
-                throw new ServiceException(-900, "导出异常");
-            }
-        }*/
-    }
 
-
-    @Override
-    public void getDeviceListExcelV2(Integer sysId, Integer buildingId, String deviceNo, Integer status, Integer manufacturerId, String equipmentType, String model, Integer isTag, Integer floor, String locDesc, Integer province, Integer city, Integer region, Integer community, String concentratorNo, String collectorNo, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, Integer registerStatus, Integer issueStatus, Integer syncStatus, Double startReading, Double endReading, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
-        LoginUser loginUser = UserUtil.getCurrentUser();
-
-        List<DeviceDto> list = deviceMapper.getList(sysId, buildingId, loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status, manufacturerId,
-                equipmentType, model, isTag, floor, locDesc, province, city, region, community, concentratorNo, collectorNo, null, errorType, customerId,
-                days, startDays, endDays, deviceTypeId, valveStatus, registerStatus, issueStatus, syncStatus, startReading, endReading, sortColumn, sortOrder);
-        String title = "设备列表";
-        //判断是否是水表场景
-        WMeterType wMeterType = wMeterTypeMapper.getChannelIdAndLevel(sysId, 2);
-        Channel channel = channelMapper.findById(sysId);
-        if (wMeterType != null || sysId == -99) {
-            DateTimeFormatter df = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss");
-            String[] rowsName = new String[]{"序号", "设备编号", "水表电子号", "设备型号", "建筑", "安装地址", "设备状态", "当前读数", "最后上报时间"};
-            List<Object[]> dataList = newArrayList();
-            Object[] objs = null;
-            for (int i = 0; i < list.size(); i++) {
-                DeviceDto deviceDto = list.get(i);
-                objs = new Object[rowsName.length];
-                objs[0] = i;
-                objs[1] = deviceDto.getDeviceNo();
-                objs[2] = deviceDto.getWaterMeterNo();
-                objs[3] = deviceDto.getManufacturerName()+"/"+deviceDto.getEquipmentType()+"/"+deviceDto.getManufacturerName();
-                objs[4] = deviceDto.getBuildingName();
-                objs[5] = deviceDto.getLocDesc();
-                objs[6] = this.getDeviceStatusName(deviceDto.getDeviceStatus());
-                objs[7] = deviceDto.getMeterReading();
-                objs[8] = deviceDto.getLastReceiveTime()!=null?deviceDto.getLastReceiveTime().format(df):null;
-                dataList.add(objs);
-            }
-            ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-            try {
-                excelUtil.export(httpServletResponse);
-            } catch (Exception e) {
-                throw new ServiceException(-900, "导出异常");
-            }
-        } else {
-            String[] rowsName = new String[]{"序号", "状态", "编号", "系列", "型号", "厂商", "所属建筑", "楼层", "位置"};
-            List<Object[]> dataList = newArrayList();
-            Object[] objs = null;
-            for (int i = 0; i < list.size(); i++) {
-                DeviceDto deviceDto = list.get(i);
-                objs = new Object[rowsName.length];
-                objs[0] = i;
-                objs[1] = this.getDeviceStatusName(deviceDto.getDeviceStatus());
-                objs[2] = deviceDto.getDeviceNo();
-                objs[3] = deviceDto.getEquipmentType();
-                objs[4] = deviceDto.getModel();
-                objs[5] = deviceDto.getManufacturerName();
-                objs[6] = deviceDto.getBuildingName();
-                objs[7] = deviceDto.getFloor();
-                objs[8] = deviceDto.getLocDesc();
-                dataList.add(objs);
-            }
-            ExcelUtil excelUtil = new ExcelUtil(title, rowsName, dataList);
-            try {
-                excelUtil.export(httpServletResponse);
-            } catch (Exception e) {
-                throw new ServiceException(-900, "导出异常");
-            }
-        }
     }
 
+
     protected String getIssueStatusName(Integer issueStatus){
         String issueStatusName = "未下发";
         if (issueStatus != null) {

+ 1 - 1
smart-city-platform/src/main/resources/json/deviceCustomColumn.json

@@ -1,7 +1,7 @@
 {
   "general": ["deviceNo", "deviceModel", "customerName", "deviceStatus", "buildingName", "locDesc", "dateCreate", "lastReceiveTime"],
   "loraMeter": ["deviceNo", "waterMeterFileNo", "waterMeterNo", "deviceModel", "customerName", "deviceStatus", "lastErrorType", "meterReading", "buildingName", "locDesc", "syncStatus", "valveStatus"],
-  "photoelectricMeter": ["waterMeterNo","waterMeterFileNo", "deviceModel", "customerName", "deviceStatus", "concentratorName", "collectorName", "issueStatus", "meterReading", "buildingName", "locDesc", "valveStatus"],
+  "photoelectricMeter": ["waterMeterNo","waterMeterFileNo", "deviceModel", "customerName", "deviceStatus", "concentratorName", "channelNumberName","collectorName", "issueStatus", "meterReading", "buildingName", "installTime"],
   "nbiotMeter": ["deviceNo", "waterMeterNo","waterMeterFileNo", "deviceModel", "customerName", "deviceStatus", "lastErrorType", "meterReading", "buildingName", "locDesc", "registerStatus", "valveStatus"],
   "waterQualityMeter": ["deviceNo", "deviceModel", "customerName", "deviceStatus", "buildingName", "locDesc", "lastReceiveTime"],
   "flowmeter": ["deviceNo", "deviceModel", "customerName", "deviceStatus", "buildingName", "locDesc", "lastReceiveTime"],

+ 6 - 9
smart-city-platform/src/main/resources/mapper/BuildingMapper.xml

@@ -1079,12 +1079,12 @@
         right join (
             select sd.building_id,count(1) as device_count
             from sc_device sd
-            <if test="(equipmentType != null and equipmentType != '') or (model != null and model != '') or (valveStatus != null)">left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)</if>
+            <if test=" (valveStatus != null)">left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)</if>
             <if test="province != null or city != null or region != null or community != null">left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)</if>
-            <if test="(concentratorNo != null and concentratorNo != '') or (collectorNo != null and collectorNo != '') or issueStatus != null">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)</if>
+            <if test="concentratorId != null or collectorId != null or channelNumberId != null or (concentratorNo != null and concentratorNo != '') or (collectorNo != null and collectorNo != '') or issueStatus != null">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)</if>
             <if test="concentratorNo != null and concentratorNo != ''">left join sc_concentrator scon on ( scon.id = swrd.concentrator_id and scon.status = 1)</if>
             <if test="collectorNo != null and collectorNo != ''">left join sc_collector scol on ( scol.id = swrd.collector_id)</if>
-            <if test="(errorType != null and errorType != '') or days != null or startDays != null or endDays != null or (valveStatus != null) or startReading != null or endReading != null">left join sc_water_meter_error_days swmed on ( swmed.device_id = sd.id)</if>
+            <if test="(errorType != null and errorType != '') or days != null or (valveStatus != null) or startReading != null or endReading != null">left join sc_water_meter_error_days swmed on ( swmed.device_id = sd.id)</if>
             <if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
             where sd.status = 1 and sys_id <![CDATA[ <> ]]> -99
             <!--and sd.site_id = 1-->
@@ -1093,24 +1093,21 @@
             <if test="siteId != null"> AND sd.site_id = #{siteId}</if>
             <if test="deviceNo != null and deviceNo != ''"> AND (sd.device_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_file_no LIKE concat('%',#{deviceNo},'%'))</if>
             <if test="status != null"> AND sd.device_status = #{status}</if>
-            <if test="manufacturerId != null"> AND sd.manufacturer_id = #{manufacturerId}</if>
-            <if test="equipmentType != null and equipmentType != ''"> AND sdt.equipment_type LIKE concat('%',#{equipmentType},'%')</if>
-            <if test="model != null and model != ''"> AND sdt.model LIKE concat('%',#{model},'%')</if>
             <if test="deviceTypeId != null"> AND sd.device_type = #{deviceTypeId}</if>
             <if test="floor != null"> AND sd.floor = #{floor}</if>
-            <if test="isTag != null"> AND sd.is_tag = #{isTag}</if>
             <if test="locDesc != null and locDesc != ''"> AND sd.loc_desc LIKE concat('%',#{locDesc},'%')</if>
             <if test="province != null"> and sb.province = #{province}</if>
             <if test="city != null"> and sb.city = #{city}</if>
             <if test="region != null"> and sb.region = #{region}</if>
             <if test="community != null"> and sb.community = #{community}</if>
+            <if test="concentratorId != null"> and swrd.concentrator_id = #{concentratorId}</if>
             <if test="concentratorNo != null and concentratorNo != ''"> AND scon.serial_number LIKE concat('%',#{concentratorNo},'%')</if>
+            <if test="collectorId != null"> and swrd.collector_id = #{collectorId}</if>
             <if test="collectorNo != null and collectorNo != ''"> AND scol.collector_no LIKE concat('%',#{collectorNo},'%')</if>
+            <if test="channelNumberId != null"> and swrd.channel_number_id = #{channelNumberId}</if>
             <if test="errorType != null and errorType != ''"> AND swmed.last_error_type LIKE concat('%',#{errorType},'%')</if>
             <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
             <if test="days != null"> and swmed.days = #{days} </if>
-            <if test="startDays != null"> and swmed.days >= #{startDays} </if>
-            <if test="endDays != null"> and swmed.days <![CDATA[ <= ]]> #{endDays} </if>
             <if test="startReading != null"> and swmed.meter_reading >= #{startReading} </if>
             <if test="endReading != null"> and swmed.meter_reading <![CDATA[ <= ]]> #{endReading} </if>
             <if test="valveStatus != null and valveStatus == 0"> and swmed.valve_status = #{valveStatus} and sdt.is_valve = 1</if>

+ 13 - 20
smart-city-platform/src/main/resources/mapper/DeviceMapper.xml

@@ -363,8 +363,8 @@
         sb.name as building_name,sc.channel_name as system_name,
         sb.longitude,sb.latitude,
         sb.province,sb.city,sb.region,sb.community,scom.name as community_name,
-        swrd.concentrator_id,swrd.collector_id,swrd.channel_number_id,swrd.port,swrd.issue_status,
-        scon.serial_number as concentrator_name,scol.collector_no as collector_name,
+        <if test="sysId==55">swrd.concentrator_id,swrd.collector_id,swrd.channel_number_id,swrd.port,swrd.issue_status,
+        scon.serial_number as concentrator_name,scol.collector_no as collector_name,scn.channel_name as channel_number_name,</if>
         scus.customer_name,
         sil.plan_time,sil.install_time,sil.accept_time,
         swmed.days,swmed.last_error_type,
@@ -377,9 +377,10 @@
         left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)
         left join sc_channel sc on (sc.id = sd.sys_id and sc.status = 1)
         left join sc_community scom on ( scom.id = sb.community and scom.status = 1)
-        left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)
+        <if test="sysId==55">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)
         left join sc_concentrator scon on ( scon.id = swrd.concentrator_id and scon.status = 1)
         left join sc_collector scol on ( scol.id = swrd.collector_id)
+        left join sc_channel_number scn on ( scn.id = swrd.channel_number_id)</if>
         left join sc_water_meter_error_days swmed on ( swmed.device_id = sd.id)
         left join sc_customer scus on ( scus.id = sd.customer_id)
         left join sc_install_list sil on (sil.device_id = sd.id)
@@ -391,19 +392,18 @@
         <if test="siteId != null"> AND sd.site_id = #{siteId}</if>
         <if test="deviceNo != null and deviceNo != ''"> AND (sd.device_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_file_no LIKE concat('%',#{deviceNo},'%'))</if>
         <if test="status != null"> AND sd.device_status = #{status}</if>
-        <if test="manufacturerId != null"> AND sd.manufacturer_id = #{manufacturerId}</if>
-        <if test="equipmentType != null and equipmentType != ''"> AND sdt.equipment_type LIKE concat('%',#{equipmentType},'%')</if>
-        <if test="model != null and model != ''"> AND sdt.model LIKE concat('%',#{model},'%')</if>
         <if test="deviceTypeId != null"> AND sd.device_type = #{deviceTypeId}</if>
         <if test="floor != null"> AND sd.floor = #{floor}</if>
-        <if test="isTag != null"> AND sd.is_tag = #{isTag}</if>
         <if test="locDesc != null and locDesc != ''"> AND sd.loc_desc LIKE concat('%',#{locDesc},'%')</if>
         <if test="province != null"> and sb.province = #{province}</if>
         <if test="city != null"> and sb.city = #{city}</if>
         <if test="region != null"> and sb.region = #{region}</if>
         <if test="community != null"> and sb.community = #{community}</if>
+        <if test="concentratorId != null"> AND swrd.concentrator_id = #{concentratorId}</if>
         <if test="concentratorNo != null and concentratorNo != ''"> AND scon.serial_number LIKE concat('%',#{concentratorNo},'%')</if>
+        <if test="collectorId != null"> AND swrd.collector_id = #{channelNumberId}</if>
         <if test="collectorNo != null and collectorNo != ''"> AND scol.collector_no LIKE concat('%',#{collectorNo},'%')</if>
+        <if test="channelNumberId != null">AND swrd.channel_number_id = #{collectorId}</if>
         <if test="errorType != null and errorType != ''"> AND swmed.last_error_type LIKE concat('%',#{errorType},'%')</if>
         <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
         <if test="valveStatus != null and valveStatus == 0"> and swmed.valve_status = #{valveStatus} and sdt.is_valve = 1</if>
@@ -414,7 +414,6 @@
         <if test="syncStatus != null"> and sd.sync_status = #{syncStatus}</if>
         <if test="startReading != null"> and swmed.meter_reading >= #{startReading} </if>
         <if test="endReading != null"> and swmed.meter_reading <![CDATA[ <= ]]> #{endReading} </if>
-        <if test="channelNumberId != null"> and swrd.channel_number_id = #{channelNumberId} </if>
         <if test="days != null">
             <choose>
                 <when test="days == 0">
@@ -425,8 +424,6 @@
                 </otherwise>
             </choose>
         </if>
-        <if test="startDays != null"> and swmed.days >= #{startDays} </if>
-        <if test="endDays != null"> and swmed.days <![CDATA[ <= ]]> #{endDays} </if>
         <if test="programItems != null and programItems.size() != 0"> and
             <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
                 sdd.${item.dimensionCode} = #{item.dimensionValue}
@@ -443,12 +440,11 @@
     <select id="getList_COUNT" resultType="Long">
         select count(1)
         from sc_device sd
-        <if test="(equipmentType != null and equipmentType != '') or (model != null and model != '') or (valveStatus != null)">left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)</if>
         <if test="province != null or city != null or region != null or community != null">left join sc_building sb on (sb.id = sd.building_id and sb.status = 1)</if>
-        <if test="(concentratorNo != null and concentratorNo != '') or (collectorNo != null and collectorNo != '') or issueStatus != null or channelNumberId != null">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)</if>
+        <if test="concentratorId != null or collectorId != null or channelNumberId != null or(concentratorNo != null and concentratorNo != '') or (collectorNo != null and collectorNo != '') or issueStatus != null">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)</if>
         <if test="concentratorNo != null and concentratorNo != ''">left join sc_concentrator scon on ( scon.id = swrd.concentrator_id and scon.status = 1)</if>
         <if test="collectorNo != null and collectorNo != ''">left join sc_collector scol on ( scol.id = swrd.collector_id)</if>
-        <if test="(errorType != null and errorType != '') or days != null or startDays != null or endDays != null or (valveStatus != null) or startReading != null or endReading != null">left join sc_water_meter_error_days swmed on ( swmed.device_id = sd.id)</if>
+        <if test="(errorType != null and errorType != '') or days != null or (valveStatus != null) or startReading != null or endReading != null">left join sc_water_meter_error_days swmed on ( swmed.device_id = sd.id)</if>
         <if test="programItems != null and programItems.size() != 0">left join sc_device_dimension sdd on (sdd.device_id = sd.id and sdd.status = 1)</if>
         where sd.status = 1
         <if test="sysId != null"> AND sd.sys_id = #{sysId}</if>
@@ -456,19 +452,18 @@
         <if test="siteId != null"> AND sd.site_id = #{siteId}</if>
         <if test="deviceNo != null and deviceNo != ''"> AND (sd.device_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_no LIKE concat('%',#{deviceNo},'%') or sd.water_meter_file_no LIKE concat('%',#{deviceNo},'%'))</if>
         <if test="status != null"> AND sd.device_status = #{status}</if>
-        <if test="manufacturerId != null"> AND sd.manufacturer_id = #{manufacturerId}</if>
-        <if test="equipmentType != null and equipmentType != ''"> AND sdt.equipment_type LIKE concat('%',#{equipmentType},'%')</if>
-        <if test="model != null and model != ''"> AND sdt.model LIKE concat('%',#{model},'%')</if>
         <if test="deviceTypeId != null"> AND sd.device_type = #{deviceTypeId}</if>
         <if test="floor != null"> AND sd.floor = #{floor}</if>
-        <if test="isTag != null"> AND sd.is_tag = #{isTag}</if>
         <if test="locDesc != null and locDesc != ''"> AND sd.loc_desc LIKE concat('%',#{locDesc},'%')</if>
         <if test="province != null"> and sb.province = #{province}</if>
         <if test="city != null"> and sb.city = #{city}</if>
         <if test="region != null"> and sb.region = #{region}</if>
         <if test="community != null"> and sb.community = #{community}</if>
+        <if test="concentratorId != null"> AND swrd.concentrator_id = #{concentratorId}</if>
         <if test="concentratorNo != null and concentratorNo != ''"> AND scon.serial_number LIKE concat('%',#{concentratorNo},'%')</if>
+        <if test="collectorId != null"> AND swrd.collector_id = #{channelNumberId}</if>
         <if test="collectorNo != null and collectorNo != ''"> AND scol.collector_no LIKE concat('%',#{collectorNo},'%')</if>
+        <if test="channelNumberId != null">AND swrd.channel_number_id = #{collectorId}</if>
         <if test="errorType != null and errorType != ''"> AND swmed.last_error_type LIKE concat('%',#{errorType},'%')</if>
         <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
         <if test="valveStatus != null and valveStatus == 0"> and swmed.valve_status = #{valveStatus} and sdt.is_valve = 1</if>
@@ -479,7 +474,6 @@
         <if test="syncStatus != null"> and sd.sync_status = #{syncStatus}</if>
         <if test="startReading != null"> and swmed.meter_reading >= #{startReading} </if>
         <if test="endReading != null"> and swmed.meter_reading <![CDATA[ <= ]]> #{endReading} </if>
-        <if test="channelNumberId != null"> and swrd.channel_number_id = #{channelNumberId} </if>
         <if test="days != null">
             <choose>
                 <when test="days == 0">
@@ -490,8 +484,7 @@
                 </otherwise>
             </choose>
         </if>
-        <if test="startDays != null"> and swmed.days >= #{startDays} </if>
-        <if test="endDays != null"> and swmed.days <![CDATA[ <= ]]> #{endDays} </if>
+
         <if test="programItems != null and programItems.size() != 0"> and
             <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
                 sdd.${item.dimensionCode} = #{item.dimensionValue}

+ 6 - 6
smart-city-platform/src/test/java/com/bz/smart_city/ForCreateDataTest.java

@@ -99,7 +99,7 @@ public class ForCreateDataTest {
         Integer systemId = 18;
         Integer siteId = 37;
         String prefix = "30393731";
-        List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null, null, null, null, null, null, null, null, null, null, null,null);
+        /*List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null, null, null, null, null, null, null, null, null, null, null,null);
         int i = 0;
         for (DeviceDto d : devices) {
             if (i % 100 == 0) {
@@ -111,7 +111,7 @@ public class ForCreateDataTest {
             }
             buildTempData(d.getDeviceNo(), getTempData(buildingMapper.getBuilding(10).getCityName().substring(0, 2)));
             i++;
-        }
+        }*/
     }
 
     /**
@@ -195,7 +195,7 @@ public class ForCreateDataTest {
         Integer systemId = 4;
         Integer siteId = 37;
         String prefix = "004a70124";
-        List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null);
+        /*List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null);
         int i = 0;
         for (DeviceDto d : devices) {
             if (i % 100 == 0) {
@@ -207,7 +207,7 @@ public class ForCreateDataTest {
             }
             buildYGData(d.getDeviceNo(), "020000");
             i++;
-        }
+        }*/
     }
 
     /**
@@ -218,12 +218,12 @@ public class ForCreateDataTest {
         Integer systemId = 4;
         Integer siteId = 37;
         String prefix = "004a70124";
-        List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null);
+        /*List<DeviceDto> devices = deviceMapper.getList(systemId, null, siteId, null, prefix, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,null);
 
         for (int i = 0; i < 105; i++) {
             DeviceDto d = devices.get(getRandom(devices.size()));
             buildYGData(d.getDeviceNo(), "020400");
-        }
+        }*/
     }
 
     public String getSuffix(int length) {