Ver código fonte

批量注册、已装水表列表和设备列表

lin 4 anos atrás
pai
commit
9f92288f5e

+ 19 - 8
smart-city-platform/src/main/java/com/bz/smart_city/controller/DeviceController.java

@@ -58,13 +58,16 @@ public class DeviceController {
             @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 = "排序参数,对应列表字段", required = false) @RequestParam(required = false) String sortColumn,
-            @ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false) String sortOrder,
+            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
+            @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,
             @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, errorType, customerId, days, startDays,endDays, sortColumn, sortOrder, pageNum, pageSize);
+                floor, StringUtils.trim(locDesc), province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays,endDays,
+                deviceTypeId,valveStatus,sortColumn, sortOrder, pageNum, pageSize);
         return new AjaxMessage<>(ResultStatus.OK, pageInfo);
     }
 
@@ -106,12 +109,15 @@ public class DeviceController {
             @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 = "排序参数,对应列表字段", required = false) @RequestParam(required = false) String sortColumn,
-            @ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false) String sortOrder,
+            @ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
+            @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(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, sortColumn, sortOrder, httpServletResponse);
+                floor, StringUtils.trim(locDesc), province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays, endDays,
+                deviceTypeId,valveStatus,sortColumn, sortOrder, httpServletResponse);
 
     }
 
@@ -130,6 +136,8 @@ public class DeviceController {
             @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 = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+            @ApiParam(value = "阀门状态 0:关阀 1:开阀  2:无阀", required = false) @RequestParam(required = false) Integer valveStatus,
             HttpServletResponse httpServletResponse
     ){
         deviceService.exportDeviceListAsXML(sysId,
@@ -171,10 +179,12 @@ public class DeviceController {
             @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 = "连续故障结束天数", 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
     ) {
         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);
+                floor, locDesc, province, city, region, community, concentratorNo, collectorNo, errorType, customerId, days, startDays,endDays,deviceTypeId,valveStatus);
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
 
@@ -289,4 +299,5 @@ public class DeviceController {
         }
         return msg;
     }
+
 }

+ 23 - 5
smart-city-platform/src/main/java/com/bz/smart_city/controller/assistant/InstallController.java

@@ -203,15 +203,18 @@ public class InstallController {
 			@ApiParam(value = "小区", 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 locDesc,
+			@ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+			@ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
 			@ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
 			@ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate,
-			@ApiParam(value = "排序参数,对应列表字段", required = false) @RequestParam(required = false) String sortColumn,
-			@ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false) String sortOrder,
+			@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,
 			@ApiParam(value = "页数,默认第一条", required = true, defaultValue = "1") @RequestParam(required = true, defaultValue = "1") int pageNum,
 			@ApiParam(value = "每页显示数,默认第15条", required = true, defaultValue = "15") @RequestParam(required = true, defaultValue = "15") int pageSize,
 			HttpServletRequest httpServletRequest
 	) {
-		Pagination<DeviceDto> pagination = deviceService.getInstallPage(deviceNo,status,errorType,customerId,province,city,region,community,buildingId,locDesc,
+		Pagination<DeviceDto> pagination = deviceService.getInstallPage(deviceNo,status,errorType,customerId,province,city,region,community,
+				buildingId,locDesc,deviceTypeId,registerStatus,
 				startDate,endDate,sortColumn,sortOrder, pageNum, pageSize);
 		return new AjaxMessage<>(ResultStatus.OK, pagination);
 	}
@@ -231,13 +234,15 @@ public class InstallController {
 		@ApiParam(value = "小区", 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 locDesc,
+		@ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+		@ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
 		@ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
 		@ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate,
 		@ApiParam(value = "排序参数,对应列表字段", required = false) @RequestParam(required = false) String sortColumn,
 		@ApiParam(value = "排序方式,顺序:ASC  倒序:DESC", required = false) @RequestParam(required = false) String sortOrder,
 		@ApiParam(value = "token", required = true) @RequestParam(required = true) String token,
 		HttpServletResponse httpServletResponse){
-		deviceService.exportInstallList(deviceNo,status,errorType,customerId,province,city,region,community,buildingId,locDesc,
+		deviceService.exportInstallList(deviceNo,status,errorType,customerId,province,city,region,community,buildingId,locDesc,deviceTypeId,registerStatus,
 				startDate,endDate,sortColumn,sortOrder,httpServletResponse);
 	}
 
@@ -255,10 +260,13 @@ public class InstallController {
             @ApiParam(value = "小区", 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 locDesc,
+			@ApiParam(value = "设备类型ID", required = false) @RequestParam(required = false) Integer deviceTypeId,
+			@ApiParam(value = "注册状态 0:未注册 1:已注册", required = false) @RequestParam(required = false) Integer registerStatus,
             @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime startDate,
             @ApiParam(value = "开始时间 格式:yyyyMMddHHmmss", required = false) @RequestParam(required = false) @DateTimeFormat(pattern = "yyyyMMddHHmmss") LocalDateTime endDate
     ) {
-        List<BuildingSelectDto> list = buildingService.installAreaList(deviceNo, status,errorType,customerId,province,city,region,community,buildingId,locDesc,startDate,endDate);
+        List<BuildingSelectDto> list = buildingService.installAreaList(deviceNo, status,errorType,customerId,province,city,region,community,buildingId,locDesc,
+				deviceTypeId,registerStatus,startDate,endDate);
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
 
@@ -282,4 +290,14 @@ public class InstallController {
     	int result = installManagerService.importInstallList(dto, file);
         return new AjaxMessage(ResultStatus.OK, result);
     }
+
+	@ResponseBody
+	@PostMapping("batchRegister")
+	@ApiOperation(value = "批量注册")
+	public AjaxMessage batchRegister(
+			@ApiParam(value = "设备id,多个英文逗号隔开", required = true) @RequestParam(required = true) List<Long> deviceIds
+	){
+		deviceService.batchRegister(deviceIds);
+		return new AjaxMessage(ResultStatus.OK);
+	}
 }

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

@@ -67,11 +67,11 @@ 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);
+    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);
 
     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);
 
-    List<BuildingSelectInfoDto> installAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("buildingId") Integer buildingId, @Param("locDesc") String locDesc, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
+    List<BuildingSelectInfoDto> installAreaList(@Param("siteId") Integer siteId, @Param("programItems") List<ProgramItem> programItems, @Param("deviceNo") String deviceNo, @Param("status") Integer status, @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("province") Integer province, @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("buildingId") Integer buildingId, @Param("locDesc") String locDesc, @Param("deviceTypeId") Integer deviceTypeId, @Param("registerStatus") Integer registerStatus, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate);
 
     List<Building> getBuildingByInstallPlanId(@Param("installPlanId") Integer installPlanId);
 

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

@@ -31,9 +31,10 @@ public interface DeviceMapper {
                             @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("sortColumn") String sortColumn, @Param("sortOrder") String sortOrder);
+                            @Param("startDays") Integer startDays, @Param("endDays") Integer endDays, @Param("deviceTypeId") Integer deviceTypeId, @Param("valveStatus") Integer valveStatus, @Param("sortColumn") String sortColumn, @Param("sortOrder") String sortOrder);
+
     //按设备编号查询
-    List<DeviceDto> getWaterMeterListByDeviceNo(@Param("deviceNo") String deviceNo,@Param("waterMeterNo") String waterMeterNo);
+    List<DeviceDto> getWaterMeterListByDeviceNo(@Param("deviceNo") String deviceNo, @Param("waterMeterNo") String waterMeterNo);
 
     List<JinNanSyncDTO> getSyncMeterDeviceList(
             @Param("sysId") Integer sysId,
@@ -96,7 +97,7 @@ public interface DeviceMapper {
     List<DeviceDto> getInstallList(@Param("siteId") Integer siteId, @Param("sysId") Integer sysId, @Param("deviceNo") String deviceNo, @Param("status") Integer status,
                                    @Param("errorType") String errorType, @Param("customerId") Integer customerId, @Param("province") Integer province,
                                    @Param("city") Integer city, @Param("region") Integer region, @Param("community") Integer community, @Param("buildingId") Integer buildingId,
-                                   @Param("locDesc") String locDesc, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
+                                   @Param("locDesc") String locDesc, @Param("deviceTypeId") Integer deviceTypeId, @Param("registerStatus") Integer registerStatus, @Param("startDate") LocalDateTime startDate, @Param("endDate") LocalDateTime endDate,
                                    @Param("programItems") List<ProgramItem> programItems, @Param("sortColumn") String sortColumn, @Param("sortOrder") String sortOrder);
 
     List<DeviceDto> queryDeviceByNo(@Param("siteId") Integer siteId,
@@ -115,7 +116,7 @@ public interface DeviceMapper {
 
     List<DeviceCustomerInfo> getDeviceCustomerInfo(@Param("buildingId") Integer buildingId);
 
-    List<DeviceDto> getDeviceListByCustomer(@Param("customerId") Integer customerId,@Param("deviceStatus")Integer deviceStatus);
+    List<DeviceDto> getDeviceListByCustomer(@Param("customerId") Integer customerId, @Param("deviceStatus") Integer deviceStatus);
 
     List<Long> findDeviceIdByDeviceNo(@Param("id") Long id, @Param("deviceNo") String deviceNo);
 
@@ -147,6 +148,6 @@ public interface DeviceMapper {
 
     Device findByDeviceIdIgnore(@Param("deviceId") Long deviceId);
 
-    List<Device> findByAccountId(@Param("accountId")BigInteger accountId);
+    List<Device> findByAccountId(@Param("accountId") BigInteger accountId);
 }
 

+ 3 - 0
smart-city-platform/src/main/java/com/bz/smart_city/dto/DeviceDto.java

@@ -110,4 +110,7 @@ public class DeviceDto extends Device {
     @ApiModelProperty(value="阀门按钮状态 0:关阀 1:开阀",position = 125)
     private Integer valveButtonStatus = 1;
 
+    @ApiModelProperty(value="是否有无阀门 0:无 1:有",position = 125)
+    private Integer isValve;
+
 }

+ 3 - 0
smart-city-platform/src/main/java/com/bz/smart_city/entity/Device.java

@@ -94,6 +94,9 @@ public class Device {
     @ApiModelProperty(value = "udip平台id", position = 20)
     private String udipId;
 
+    @ApiModelProperty(value = "是否注册", position = 20)
+    private Integer registerStatus;
+
     @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     @ApiModelProperty(value = "设备最后上报时间", position = 21)
     private LocalDateTime lastReceiveTime;

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

@@ -81,9 +81,9 @@ 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);
+    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);
 
     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);
 
-    List<BuildingSelectDto> installAreaList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate);
+    List<BuildingSelectDto> installAreaList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate);
 }

+ 6 - 5
smart-city-platform/src/main/java/com/bz/smart_city/service/DeviceService.java

@@ -12,7 +12,6 @@ import com.bz.smart_city.dto.assistant.PlanCommunityDTO;
 import com.bz.smart_city.entity.Device;
 import com.bz.smart_city.entity.ProgramItem;
 import com.bz.smart_city.entity.Site;
-import org.apache.ibatis.annotations.Param;
 import org.springframework.web.multipart.MultipartFile;
 
 import javax.servlet.http.HttpServletResponse;
@@ -39,13 +38,13 @@ public interface DeviceService{
 
     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, String errorType,
-                                  Integer customerId,Integer days, Integer startDays, Integer endDays, String sortColumn, String sortOrder, int pageNum, int pageSize);
+                                  Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, String sortColumn, String sortOrder, int pageNum, int pageSize);
 
     List<DeviceDto> getWaterMeterListByDeviceNo(String deviceNo,String waterMeterNo);
 
     void getDeviceListExcel(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, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
+                            Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
 
 
     void exportDeviceListAsXML(Integer sysId,
@@ -104,10 +103,10 @@ public interface DeviceService{
 
     void updateDeviceError(Long deviceId, String lastErrorType);
 
-    Pagination<DeviceDto> getInstallPage(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, int pageNum, int pageSize);
+    Pagination<DeviceDto> getInstallPage(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, int pageNum, int pageSize);
 
 
-    void exportInstallList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder,HttpServletResponse httpServletResponse);
+    void exportInstallList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse);
 
     Device deviceDetail(Long deviceId);
     Pagination<DeviceDto> simpleQueryDeviceList(Integer siteId,Integer channelId , String deviceNo,String waterMeterNo, int pageNum, int pageSize);
@@ -123,4 +122,6 @@ public interface DeviceService{
     List<Device> findByAccountId(BigInteger accountId);
 
     void setValve(Long deviceId);
+
+    void batchRegister(List<Long> deviceIds);
 }

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

@@ -925,10 +925,10 @@ 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) {
+    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) {
         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);
+        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);
 
         return this.areaList(buildingList);
     }
@@ -945,12 +945,12 @@ public class BuildingServiceImpl implements BuildingService {
     }
 
     @Override
-    public List<BuildingSelectDto> installAreaList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer communityId, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate) {
+    public List<BuildingSelectDto> installAreaList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer communityId, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate) {
 
         LoginUser loginUser = UserUtil.getCurrentUser();
 
         //查询用户数据项下的建筑列表
-        List<BuildingSelectInfoDto> buildingList = buildingMapper.installAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status, errorType, customerId, province, city, region, communityId, buildingId, locDesc, startDate, endDate);
+        List<BuildingSelectInfoDto> buildingList = buildingMapper.installAreaList(loginUser.getSiteId(), UserUtil.getCurrentSiteProgramItems(loginUser), deviceNo, status, errorType, customerId, province, city, region, communityId, buildingId, locDesc, deviceTypeId, registerStatus, startDate, endDate);
 
         return this.areaList(buildingList);
     }

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

@@ -40,6 +40,7 @@ import java.net.URLEncoder;
 import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
+import java.util.concurrent.atomic.AtomicInteger;
 
 import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.multipart.MultipartFile;
@@ -149,13 +150,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, String errorType, Integer customerId, Integer days,Integer startDays,Integer endDays, String sortColumn, String sortOrder, int pageNum, int pageSize) {
+    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, String errorType, Integer customerId, Integer days, Integer startDays, Integer endDays, Integer deviceTypeId, Integer valveStatus, String sortColumn, String sortOrder, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
-        List<ProgramItem> aa = UserUtil.getCurrentSiteProgramItems(loginUser);
+
         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, errorType, customerId,
-                days, startDays, endDays, sortColumn, sortOrder);
+                days, startDays, endDays,deviceTypeId, valveStatus, sortColumn, sortOrder);
         return new Pagination<>(list);
     }
 
@@ -166,12 +167,12 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public void getDeviceListExcel(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, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
+    public void getDeviceListExcel(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, 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, errorType, customerId,
-                days, startDays, endDays,sortColumn, sortOrder);
+                days, startDays, endDays, deviceTypeId, valveStatus, sortColumn, sortOrder);
         String title = "设备列表";
         //判断是否是水表场景
         WMeterType wMeterType = wMeterTypeMapper.getChannelIdAndLevel(sysId, 2);
@@ -1194,15 +1195,15 @@ public  class DeviceServiceImpl implements DeviceService {
     }
 
     @Override
-    public Pagination<DeviceDto> getInstallPage(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, int pageNum, int pageSize) {
+    public Pagination<DeviceDto> getInstallPage(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, int pageNum, int pageSize) {
         LoginUser loginUser = UserUtil.getCurrentUser();
         PageHelper.startPage(pageNum, pageSize);
-        List<DeviceDto> list = deviceMapper.getInstallList(loginUser.getSiteId(), -99, deviceNo, status, errorType, customerId, province, city, region, community, buildingId, locDesc, startDate, endDate,UserUtil.getCurrentSiteProgramItems(loginUser),sortColumn,sortOrder);
+        List<DeviceDto> list = deviceMapper.getInstallList(loginUser.getSiteId(), -99, deviceNo, status, errorType, customerId, province, city, region, community, buildingId, locDesc, deviceTypeId, registerStatus, startDate, endDate,UserUtil.getCurrentSiteProgramItems(loginUser),sortColumn,sortOrder);
         return new Pagination<>(list);
     }
 
     @Override
-    public void exportInstallList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
+    public void exportInstallList(String deviceNo, Integer status, String errorType, Integer customerId, Integer province, Integer city, Integer region, Integer community, Integer buildingId, String locDesc, Integer deviceTypeId, Integer registerStatus, LocalDateTime startDate, LocalDateTime endDate, String sortColumn, String sortOrder, HttpServletResponse httpServletResponse) {
         String title = "已装水表清单";
         String[] rowsName = new String[]{"序号","设备状态", "设备安装时间", "设备编号", "水表电子号","水表档案号","连续故障天数",
                 "所属客户","所属小区", "所属建筑","安装地址","最后上报时间","水表当前读数","旧表止度"};
@@ -1210,7 +1211,7 @@ public  class DeviceServiceImpl implements DeviceService {
         List<Object[]> dataList = newArrayList();
         Object[] objs = null;
         LoginUser loginUser = UserUtil.getCurrentUser();
-        List<DeviceDto> rtnList = deviceMapper.getInstallList(loginUser.getSiteId(), -99, deviceNo, status, errorType, customerId, province, city, region, community, buildingId, locDesc, startDate, endDate,UserUtil.getCurrentSiteProgramItems(loginUser),sortColumn,sortOrder);
+        List<DeviceDto> rtnList = deviceMapper.getInstallList(loginUser.getSiteId(), -99, deviceNo, status, errorType, customerId, province, city, region, community, buildingId, locDesc, deviceTypeId, registerStatus, startDate, endDate,UserUtil.getCurrentSiteProgramItems(loginUser),sortColumn,sortOrder);
         for (int i = 0; i < rtnList.size(); i++) {
             DeviceDto dto = rtnList.get(i);
             objs = new Object[rowsName.length];
@@ -1370,4 +1371,33 @@ public  class DeviceServiceImpl implements DeviceService {
             waterMeterErrorDaysMapper.insert(waterMeterErrorDayUpdate);
         }
     }
+
+    @Override
+    public void batchRegister(List<Long> deviceIds) {
+        log.info("begin batchRegister,deviceIds = {}",  JSON.toJSONString(deviceIds));
+        AtomicInteger count = new AtomicInteger(0);
+        if (deviceIds != null && deviceIds.size() > 0) {
+            for (Long deviceId : deviceIds) {
+                try {
+                    Device device = deviceMapper.findByDeviceId(deviceId);
+                    //新增udip平台集成元
+                    DeviceTypeDto deviceTypeDto = deviceTypeMapper.getById(device.getDeviceType());
+                    String udipId = udipUnitService.saveUdipUnit(device.getDeviceNo(),device.getCustomerId(),deviceTypeDto);
+                    if (udipId != null) {
+                        Device deviceUpdate = new Device();
+                        deviceUpdate.setId(deviceId);
+                        deviceUpdate.setUdipId(udipId);
+                        deviceUpdate.setRegisterStatus(1);
+                        deviceUpdate.setDateUpdate(LocalDateTime.now());
+                        deviceMapper.updateByPrimaryKeySelective(deviceUpdate);
+                        count.incrementAndGet();
+                    }
+
+                }catch (Exception e){
+                    log.info("register error deviceId={},e={}",deviceId,e.getMessage());
+                }
+            }
+        }
+        log.info("end batchRegister count={}",count.get());
+    }
 }

+ 10 - 5
smart-city-platform/src/main/resources/mapper/BuildingMapper.xml

@@ -988,15 +988,15 @@
         b.latitude,
         t1.device_count
         from sc_building b
-        left join (
+        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 != '')">left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)</if>
+            <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 != '') ">left join sc_water_related_device swrd on ( swrd.device_id = sd.id and swrd.status = 1)</if>
+            <if test="(concentratorNo != null and concentratorNo != '') or (collectorNo != null and collectorNo != '')">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">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 startDays != null or endDays != null or (valveStatus != 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 != -99
             <!--and sd.site_id = 1-->
@@ -1008,6 +1008,7 @@
             <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>
@@ -1022,6 +1023,8 @@
             <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="valveStatus != null and valveStatus != 2"> and swmed.valve_status = #{valveStatus} </if>
+            <if test="valveStatus != null and valveStatus == 2"> and sdt.is_valve = 0 </if>
             <if test="programItems != null and programItems.size() != 0"> and
                 <foreach collection="programItems" item="item" open="(" separator=" or " close=")">
                     sdd.${item.dimensionCode} = #{item.dimensionValue}
@@ -1127,7 +1130,7 @@
         b.latitude,
         t1.device_count
         from sc_building b
-        left join (
+        right join (
         select sd.building_id,count(1) as device_count
         from sc_device sd
         <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>
@@ -1145,6 +1148,8 @@
         <if test="community != null"> and sb.community = #{community}</if>
         <if test="errorType != null and errorType != ''"> AND swmed.last_error_type LIKE concat('%',#{errorType},'%')</if>
         <if test="locDesc != null and locDesc != ''"> AND sd.loc_desc LIKE concat('%',#{locDesc},'%')</if>
+        <if test="deviceTypeId != null"> and sd.device_type = #{deviceTypeId}</if>
+        <if test="registerStatus != null"> and sd.register_status = #{registerStatus}</if>
         <if test="customerId != null"> and sd.customer_id = #{customerId}</if>
         <if test="startDate != null"> and sil.install_time <![CDATA[ >= ]]> #{startDate}</if>
         <if test="endDate != null"> and sil.install_time <![CDATA[ <= ]]> #{endDate}</if>

+ 15 - 5
smart-city-platform/src/main/resources/mapper/DeviceMapper.xml

@@ -338,7 +338,8 @@
                 <if test="device.waterMeterNo != null"> water_meter_no = #{device.waterMeterNo,jdbcType=VARCHAR},</if>
                 <if test="device.waterMeterFileNo != null"> water_meter_file_no = #{device.waterMeterFileNo,jdbcType=VARCHAR},</if>
                 <if test="device.customerId != null"> customer_id = #{device.customerId,jdbcType=INTEGER},</if>
-                <if test="device.udipId != null"> udip_id = #{device.udipId,jdbcType=INTEGER}</if>
+                <if test="device.udipId != null"> udip_id = #{device.udipId,jdbcType=VARCHAR},</if>
+                <if test="device.registerStatus != null"> register_status = #{device.registerStatus,jdbcType=INTEGER}</if>
         </set>
 		WHERE id = #{device.id,jdbcType=BIGINT}
     </update>
@@ -351,7 +352,8 @@
         sil.plan_time,sil.install_time,sil.accept_time,
         swmed.meter_reading,
         swmed.valve_status,
-        swmed.valve_button_status
+        swmed.valve_button_status,
+        sdt.is_valve
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
         left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
@@ -375,6 +377,7 @@
         <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>
@@ -386,6 +389,8 @@
         <if test="collectorNo != null and collectorNo != ''"> AND scol.collector_no LIKE concat('%',#{collectorNo},'%')</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 != 2"> and swmed.valve_status = #{valveStatus}</if>
+        <if test="valveStatus != null and valveStatus == 2"> and sdt.is_valve = 0</if>
         <if test="days != null">
             <choose>
                 <when test="days == 0">
@@ -479,12 +484,12 @@
     <select id="getList_COUNT" resultType="Long">
         select count(1)
         from sc_device sd
-        <if test="(equipmentType != null and equipmentType != '') or (model != null and model != '')">left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)</if>
+        <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 != '') ">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">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 startDays != null or endDays != null or (valveStatus != 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>
@@ -495,6 +500,7 @@
         <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>
@@ -506,6 +512,8 @@
         <if test="collectorNo != null and collectorNo != ''"> AND scol.collector_no LIKE concat('%',#{collectorNo},'%')</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 != 2"> and swmed.valve_status = #{valveStatus}</if>
+        <if test="valveStatus != null and valveStatus == 2"> and sdt.is_valve = 0</if>
         <if test="days != null">
             <choose>
                 <when test="days == 0">
@@ -717,7 +725,7 @@
         sb.longitude,sb.latitude,
         sb.province,sb.city,sb.region,sb.community,scom.name as community_name,
         scon.serial_number as concentrator_name,scol.collector_no as collector_name,swmed.days,swmed.last_error_type,swmed.meter_reading,scus.customer_name,
-        sil.plan_time,sil.install_time,sil.accept_time,sil.new_meter_start,sil.id as install_id,sil.old_meter_end
+        sil.plan_time,sil.install_time,sil.accept_time,sil.new_meter_start,sil.id as install_id,sil.old_meter_end,sd.register_status,sdt.is_valve
         from sc_device sd
         left join sc_device_type sdt on (sdt.id = sd.device_type and sdt.status = 1)
         left join sc_device_manufacturer sdm on (sdm.id = sd.manufacturer_id and sdm.status = 1)
@@ -744,6 +752,8 @@
         <if test="community != null"> and sb.community = #{community}</if>
         <if test="buildingId != null"> and sd.building_id = #{buildingId}</if>
         <if test="locDesc != null and locDesc != ''"> AND sd.loc_desc LIKE concat('%',#{locDesc},'%')</if>
+        <if test="deviceTypeId != null"> and sd.device_type = #{deviceTypeId}</if>
+        <if test="registerStatus != null"> and sd.register_status = #{registerStatus}</if>
         <if test="startDate != null"> and sil.install_time <![CDATA[ >= ]]> #{startDate}</if>
         <if test="endDate != null"> and sil.install_time <![CDATA[ <= ]]> #{endDate}</if>
         <if test="programItems != null and programItems.size() != 0"> and

+ 3 - 3
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);
+        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);
         int i = 0;
         for (DeviceDto d : devices) {
             if (i % 100 == 0) {
@@ -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);
+        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);
         int i = 0;
         for (DeviceDto d : devices) {
             if (i % 100 == 0) {
@@ -218,7 +218,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);
+        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);
 
         for (int i = 0; i < 105; i++) {
             DeviceDto d = devices.get(getRandom(devices.size()));