@@ -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(
@@ -50,4 +50,6 @@ public interface ChannelMapper {
List<ChannelDto> getOptionChanelList();
ChannelDto findChannelByCode(@Param("channelCode") String channelCode);
+ List<ChannelDeviceCountDto> getWaterChanelList();
@@ -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);
@@ -371,4 +371,9 @@ public class ChannelServiceImpl implements ChannelService {
public List<ChannelDto> getOptionChanelList() {
return channelMapper.getOptionChanelList();
+ @Override
+ public List<ChannelDeviceCountDto> getWaterChanelList() {
+ return channelMapper.getWaterChanelList();
@@ -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
+ 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>