Browse Source

批量安装BUG

lin 4 years ago
parent
commit
a9137e911f

+ 8 - 0
smart-city-platform/src/main/java/com/bz/smart_city/controller/common/CommonController.java

@@ -68,6 +68,14 @@ public class CommonController {
         return new AjaxMessage<>(ResultStatus.OK, list);
     }
 
+    @GetMapping("/getWaterChanelList")
+    @ApiOperation(value = "获取水表场景列表")
+    public AjaxMessage<List<ChannelDeviceCountDto>> getWaterChanelList(
+    ) {
+        List<ChannelDeviceCountDto> list = channelService.getWaterChanelList();
+        return new AjaxMessage<>(ResultStatus.OK, list);
+    }
+
     @GetMapping("/getChanelCountDeviceNum")
     @ApiOperation(value = "获取场景列表(统计设备数)")
     public AjaxMessage<List<ChannelDeviceCountDto>> getChanelCountDeviceNum(

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

@@ -50,4 +50,6 @@ public interface ChannelMapper {
     List<ChannelDto> getOptionChanelList();
     
     ChannelDto findChannelByCode(@Param("channelCode") String channelCode);
+
+    List<ChannelDeviceCountDto> getWaterChanelList();
 }

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

@@ -43,4 +43,6 @@ public interface ChannelService {
     List<ChannelDeviceCountDto> getChanelCountErrorNum(Integer buildingId, String deviceNo, String location, Integer alarmCategory, Integer handleStatus, Integer deviceTypeId, LocalDateTime startDate, LocalDateTime endDate);
 
     List<ChannelDto> getOptionChanelList();
+
+    List<ChannelDeviceCountDto> getWaterChanelList();
 }

+ 5 - 0
smart-city-platform/src/main/java/com/bz/smart_city/service/impl/ChannelServiceImpl.java

@@ -371,4 +371,9 @@ public class ChannelServiceImpl implements ChannelService {
     public List<ChannelDto> getOptionChanelList() {
         return channelMapper.getOptionChanelList();
     }
+
+    @Override
+    public List<ChannelDeviceCountDto> getWaterChanelList() {
+        return channelMapper.getWaterChanelList();
+    }
 }

+ 11 - 1
smart-city-platform/src/main/resources/mapper/ChannelMapper.xml

@@ -167,7 +167,7 @@
 
     <select id="getListByIds" resultType="com.bz.smart_city.dto.ChannelDeviceCountDto">
         select
-        sc.*,
+        distinct sc.*,
         IF(smt.id is null,0,1) is_water_channel
         from sc_channel sc left join sc_w_meter_type smt on (sc.id = smt.channel_id)
         where sc.status = 1 and sc.parent_id != 0
@@ -339,5 +339,15 @@
 		 and  channel_code = #{channelCode}
 	</select>
 
+    <select id="getWaterChanelList" resultType="com.bz.smart_city.dto.ChannelDeviceCountDto">
+        select
+        distinct sc.*,
+        IF(smt.id is null,0,1) is_water_channel
+        from sc_channel sc left join sc_w_meter_type smt on (sc.id = smt.channel_id)
+        where sc.status = 1 and sc.parent_id != 0
+        and smt.level= 2
+        order by sc.sort asc
+    </select>
+
 </mapper>