Commit 34708770 authored by tangwei's avatar tangwei

解决冲突

parents ea950796 65d9171f
...@@ -38,7 +38,6 @@ import java.util.concurrent.TimeUnit; ...@@ -38,7 +38,6 @@ import java.util.concurrent.TimeUnit;
@Service @Service
public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionService { public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionService {
//定时任务执行频率 当前为10分钟一次 //定时任务执行频率 当前为10分钟一次
//锦浪云请求工具封装 //锦浪云请求工具封装
...@@ -149,7 +148,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -149,7 +148,7 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
jpStation.setUserName(golangStationDetail.getUsername()); jpStation.setUserName(golangStationDetail.getUsername());
jpStation.setUserPhone(String.valueOf(golangStationDetail.getUsermobile())); jpStation.setUserPhone(String.valueOf(golangStationDetail.getUsermobile()));
jpStation.setStationContact(String.valueOf(golangStationDetail.getMobile()).toLowerCase().replace("null", "")); jpStation.setStationContact(String.valueOf(golangStationDetail.getMobile()).toLowerCase().replace("null", ""));
jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule()))?0:Math.toIntExact(golangStationDetail.getModule())); jpStation.setModuleCount(ObjectUtils.isEmpty(Math.toIntExact(golangStationDetail.getModule())) ? 0 : Math.toIntExact(golangStationDetail.getModule()));
//并网类型 //并网类型
jpStation.setState(GoLangConstant.stationStaus.get(String.valueOf(golangStationDetail.getState()))); jpStation.setState(GoLangConstant.stationStaus.get(String.valueOf(golangStationDetail.getState())));
jpStation.setThirdStationId(String.valueOf(golangStationDetail.getId())); jpStation.setThirdStationId(String.valueOf(golangStationDetail.getId()));
...@@ -509,7 +508,6 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -509,7 +508,6 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn = new HYGFJPInverterWarn(); hygfjpInverterWarn = new HYGFJPInverterWarn();
} }
hygfjpInverterWarn.setTime(System.currentTimeMillis()); hygfjpInverterWarn.setTime(System.currentTimeMillis());
hygfjpInverterWarn.setTimeLong(System.currentTimeMillis());
hygfjpInverterWarn.setSnCode(alarmDto.getAlarmDeviceSn()); hygfjpInverterWarn.setSnCode(alarmDto.getAlarmDeviceSn());
hygfjpInverterWarn.setThirdStationId(String.valueOf(alarmDto.getStationId())); hygfjpInverterWarn.setThirdStationId(String.valueOf(alarmDto.getStationId()));
hygfjpInverterWarn.setLevel(GoLangConstant.alarmLevel.get(alarmDto.getAlarmLevel())); hygfjpInverterWarn.setLevel(GoLangConstant.alarmLevel.get(alarmDto.getAlarmLevel()));
...@@ -517,7 +515,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe ...@@ -517,7 +515,14 @@ public class GoLangDataAcquisitionServiceImpl implements GoLangDataAcquisitionSe
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.JLY.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.JLY.getCode());
hygfjpInverterWarn.setTreatment(alarmDto.getAdvice()); hygfjpInverterWarn.setTreatment(alarmDto.getAdvice());
hygfjpInverterWarn.setStartTime(alarmDto.getAlarmBeginTime()); hygfjpInverterWarn.setStartTime(alarmDto.getAlarmBeginTime());
hygfjpInverterWarn.setRecoverTime(alarmDto.getAlarmEndTime()); hygfjpInverterWarn.setRecoverTime(null);
if (!ObjectUtils.isEmpty(alarmDto.getAlarmEndTime())) {
hygfjpInverterWarn.setRecoverTime(alarmDto.getAlarmEndTime());
}
hygfjpInverterWarn.setTimeLong(null);
if (!ObjectUtils.isEmpty(alarmDto.getAlarmEndTime()) && !ObjectUtils.isEmpty(alarmDto.getAlarmEndTime())) {
hygfjpInverterWarn.setTimeLong(alarmDto.getAlarmEndTime() - alarmDto.getAlarmBeginTime());
}
hygfjpInverterWarn.setState(GoLangConstant.alarmstatus.get(alarmDto.getState())); hygfjpInverterWarn.setState(GoLangConstant.alarmstatus.get(alarmDto.getState()));
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
...@@ -770,7 +770,6 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -770,7 +770,6 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpInverterWarn = new HYGFJPInverterWarn(); hygfjpInverterWarn = new HYGFJPInverterWarn();
} }
hygfjpInverterWarn.setTime(System.currentTimeMillis()); hygfjpInverterWarn.setTime(System.currentTimeMillis());
hygfjpInverterWarn.setTimeLong(System.currentTimeMillis());
hygfjpInverterWarn.setSnCode(alarmDto.getEsnCode()); hygfjpInverterWarn.setSnCode(alarmDto.getEsnCode());
hygfjpInverterWarn.setThirdStationId(String.valueOf(alarmDto.getStationCode())); hygfjpInverterWarn.setThirdStationId(String.valueOf(alarmDto.getStationCode()));
hygfjpInverterWarn.setLevel(ImasterConstant.alarmLevel.get(alarmDto.getLev().toString())); hygfjpInverterWarn.setLevel(ImasterConstant.alarmLevel.get(alarmDto.getLev().toString()));
...@@ -778,6 +777,8 @@ public class ImasterDataServiceImpl implements ImasterDataService { ...@@ -778,6 +777,8 @@ public class ImasterDataServiceImpl implements ImasterDataService {
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.HUAWEI.getCode());
hygfjpInverterWarn.setTreatment(alarmDto.getDevName()); hygfjpInverterWarn.setTreatment(alarmDto.getDevName());
hygfjpInverterWarn.setStartTime(alarmDto.getRaiseTime()); hygfjpInverterWarn.setStartTime(alarmDto.getRaiseTime());
hygfjpInverterWarn.setRecoverTime(null);
hygfjpInverterWarn.setTimeLong(null);
hygfjpInverterWarn.setState(ImasterConstant.alarmstatus.get(alarmDto.getStatus().toString())); hygfjpInverterWarn.setState(ImasterConstant.alarmstatus.get(alarmDto.getStatus().toString()));
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
......
package com.yeejoin.amos.api.householdapi.face.service.impl; package com.yeejoin.amos.api.householdapi.face.service.impl;
import cn.hutool.core.date.DatePattern;
import cn.hutool.core.date.DateTime; import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -1053,12 +1054,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1053,12 +1054,12 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
if (!CollectionUtils.isEmpty(result)) { if (!CollectionUtils.isEmpty(result)) {
for (KsolarAlarmDto ksolarAlarmDto : result) { for (KsolarAlarmDto ksolarAlarmDto : result) {
if (!ObjectUtils.isEmpty(ksolarAlarmDto.getInverterId())) { if (!ObjectUtils.isEmpty(ksolarAlarmDto.getInverterId())) {
String startTime = ksolarAlarmDto.getSaveTime(); // String startTime = ksolarAlarmDto.getSaveTime();
String recoverTime = ksolarAlarmDto.getRemoveTime(); // String recoverTime = ksolarAlarmDto.getRemoveTime();
String pattern = "yyyy-MM-dd HH:mm:ss"; // String pattern = "yyyy-MM-dd HH:mm:ss";
SimpleDateFormat sdf = new SimpleDateFormat(pattern); // SimpleDateFormat sdf = new SimpleDateFormat(pattern);
Date startTimeL = sdf.parse(startTime); // Date startTimeL = sdf.parse(startTime);
Date recoverTimeL = sdf.parse(recoverTime); // Date recoverTimeL = sdf.parse(recoverTime);
String snCode=null; String snCode=null;
...@@ -1072,7 +1073,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1072,7 +1073,7 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
} }
HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper.selectOne(new QueryWrapper<HYGFJPInverterWarn>() HYGFJPInverterWarn hygfjpInverterWarn = hygfjpInverterWarnMapper.selectOne(new QueryWrapper<HYGFJPInverterWarn>()
.eq("sn_code",snCode) .eq("sn_code",snCode)
.eq("start_time", startTimeL.getTime()) .eq("start_time",DateUtil.parse(ksolarAlarmDto.getSaveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime())
.eq("third_code", PVProducerInfoEnum.KSOLAR.getCode()) .eq("third_code", PVProducerInfoEnum.KSOLAR.getCode())
.eq("third_station_id", ksolarAlarmDto.getStationId()) .eq("third_station_id", ksolarAlarmDto.getStationId())
); );
...@@ -1081,16 +1082,22 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe ...@@ -1081,16 +1082,22 @@ public class KsolarDataAcquisitionServiceImpl implements KSolarDataAcquisitionSe
} }
hygfjpInverterWarn.setTime(System.currentTimeMillis()); hygfjpInverterWarn.setTime(System.currentTimeMillis());
hygfjpInverterWarn.setTimeLong(System.currentTimeMillis());
hygfjpInverterWarn.setSnCode(snCode); hygfjpInverterWarn.setSnCode(snCode);
hygfjpInverterWarn.setThirdStationId(ksolarAlarmDto.getStationId()); hygfjpInverterWarn.setThirdStationId(ksolarAlarmDto.getStationId());
hygfjpInverterWarn.setLevel(KSolarConstant.alarmLevel.get(ksolarAlarmDto.getLevels())); hygfjpInverterWarn.setLevel(KSolarConstant.alarmLevel.get(ksolarAlarmDto.getLevels()));
hygfjpInverterWarn.setContent(ksolarAlarmDto.getMessage()); hygfjpInverterWarn.setContent(ksolarAlarmDto.getMessage());
hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode()); hygfjpInverterWarn.setThirdCode(PVProducerInfoEnum.KSOLAR.getCode());
hygfjpInverterWarn.setTreatment(ksolarAlarmDto.getSolution()); hygfjpInverterWarn.setTreatment(ksolarAlarmDto.getSolution());
hygfjpInverterWarn.setStartTime(startTimeL.getTime()); hygfjpInverterWarn.setStartTime(DateUtil.parse(ksolarAlarmDto.getSaveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime());
hygfjpInverterWarn.setRecoverTime(recoverTimeL.getTime());
hygfjpInverterWarn.setState(KSolarConstant.alarmstatus.get(ksolarAlarmDto.getStatus())); hygfjpInverterWarn.setState(KSolarConstant.alarmstatus.get(ksolarAlarmDto.getStatus()));
hygfjpInverterWarn.setTimeLong(null);
hygfjpInverterWarn.setRecoverTime(null);
if(StringUtils.isNotBlank(ksolarAlarmDto.getRemoveTime())){
hygfjpInverterWarn.setRecoverTime(DateUtil.parse(ksolarAlarmDto.getRemoveTime(), DatePattern.NORM_DATETIME_PATTERN).getTime());
}
if(!ObjectUtils.isEmpty(ksolarAlarmDto.getSaveTime())&&!ObjectUtils.isEmpty(ksolarAlarmDto.getRemoveTime())){
hygfjpInverterWarn.setTimeLong(hygfjpInverterWarn.getRecoverTime()-hygfjpInverterWarn.getStartTime());
}
if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) { if (ObjectUtils.isEmpty(hygfjpInverterWarn.getCreatedTime())) {
hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis()); hygfjpInverterWarn.setCreatedTime(System.currentTimeMillis());
hygfjpInverterWarnMapper.insert(hygfjpInverterWarn); hygfjpInverterWarnMapper.insert(hygfjpInverterWarn);
......
...@@ -35,6 +35,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel; ...@@ -35,6 +35,7 @@ import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.ws.rs.POST; import javax.ws.rs.POST;
import java.text.DecimalFormat;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
...@@ -66,6 +67,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -66,6 +67,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
FanHealthIndexMomentMapper fanHealthIndexMomentMapper; FanHealthIndexMomentMapper fanHealthIndexMomentMapper;
@Autowired @Autowired
FanWaringRecordMapper fanWarningRecord; FanWaringRecordMapper fanWarningRecord;
public final DecimalFormat df = new DecimalFormat("#.0");
/** /**
* 新增 * 新增
* *
...@@ -381,7 +383,15 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -381,7 +383,15 @@ public class IdxBizFanHealthIndexController extends BaseController {
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
} }
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
fanHealthIndexDays.forEach(item -> {
double roundedNumber = Double.parseDouble(df.format(item.getHealthIndex()));
item.setHealthIndex(roundedNumber);
});
int total = fanHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setRecords(fanHealthIndexDays); page.setRecords(fanHealthIndexDays);
page.setTotal(total);
page.setTotal(Long.valueOf(fanHealthIndexDays.size())); page.setTotal(Long.valueOf(fanHealthIndexDays.size()));
return ResponseHelper.buildResponse(page); return ResponseHelper.buildResponse(page);
} }
...@@ -421,7 +431,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -421,7 +431,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null); List<FanHealthIndexDay> fanHealthIndexDays = fanHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subSystem, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null);
Map<String,Object> map = new HashMap<>(); Map<String,Object> map = new HashMap<>();
map.put("value",fanHealthIndexDays.get(0).getValue()); map.put("value",Double.parseDouble(df.format(fanHealthIndexDays.get(0).getValue())));
return ResponseHelper.buildResponse(map); return ResponseHelper.buildResponse(map);
} }
...@@ -706,7 +716,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -706,7 +716,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
for (FanHealthIndexDay obj : fanHealthIndexDays) { for (FanHealthIndexDay obj : fanHealthIndexDays) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue()); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly()); seriesData.add(obj.getAnomaly());
} }
...@@ -727,7 +737,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -727,7 +737,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(FanHealthIndexHour::getAnalysisTime)).collect(Collectors.toList());
for (FanHealthIndexHour obj : fanHealthIndexHours) { for (FanHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue()); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly()); seriesData.add(obj.getAnomaly());
} }
...@@ -749,7 +759,7 @@ public class IdxBizFanHealthIndexController extends BaseController { ...@@ -749,7 +759,7 @@ public class IdxBizFanHealthIndexController extends BaseController {
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(FanHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList());
for (FanHealthIndexMoment obj : fanHealthIndexMoments) { for (FanHealthIndexMoment obj : fanHealthIndexMoments) {
if (type.equals("0")){ if (type.equals("0")){
seriesData.add(obj.getHealthIndex().intValue()); seriesData.add(Double.parseDouble(df.format(obj.getHealthIndex())));
}else { }else {
seriesData.add(obj.getAnomaly()); seriesData.add(obj.getAnomaly());
} }
......
...@@ -379,10 +379,15 @@ public class IdxBizFanWarningRecordController extends BaseController { ...@@ -379,10 +379,15 @@ public class IdxBizFanWarningRecordController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectWarningPoint") @GetMapping(value = "/selectWarningPoint")
@ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表") @ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表")
public ResponseModel<List<FanWarningRecord>> selectFanWarningNum(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME) { public ResponseModel<Page<FanWarningRecord>> selectFanWarningNum(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam Integer current,@RequestParam Integer size) {
List<FanWarningRecord> maps = fanWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME); Page<FanWarningRecord> page = new Page<>();
page.setCurrent(current);
return ResponseHelper.buildResponse(maps); page.setSize(size);
List<FanWarningRecord> maps = fanWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,(current-1)*size,size);
page.setRecords(maps);
int total = fanWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME);
page.setTotal(total);
return ResponseHelper.buildResponse(page);
} }
} }
...@@ -227,7 +227,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -227,7 +227,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@ApiOperation(httpMethod = "GET",value = "TD 光伏场站/设备列表通用接口", notes = "TD 光伏场站/设备列表通用接口") @ApiOperation(httpMethod = "GET",value = "TD 光伏场站/设备列表通用接口", notes = "TD 光伏场站/设备列表通用接口")
@GetMapping(value = "/pointHealthIndexTable") @GetMapping(value = "/pointHealthIndexTable")
public ResponseModel<Object> pointHealthIndexTable(@RequestParam(value = "area",required = false) String area, public ResponseModel<Page> pointHealthIndexTable(@RequestParam(value = "area",required = false) String area,
@RequestParam(value = "station",required = false) String station, @RequestParam(value = "station",required = false) String station,
@RequestParam(value = "analysisObjType",required = false) String analysisObjType, @RequestParam(value = "analysisObjType",required = false) String analysisObjType,
@RequestParam(value = "analysisType",required = false) String analysisType, @RequestParam(value = "analysisType",required = false) String analysisType,
...@@ -239,6 +239,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -239,6 +239,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel",required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type",required = false) String type,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "requiredType",required = false) String requiredType,
@RequestParam(value = "current",required = false) Integer current,
@RequestParam(value = "size",required = false) Integer size,
@RequestParam(value = "subarray",required = false) String subarray){ @RequestParam(value = "subarray",required = false) String subarray){
...@@ -249,8 +251,14 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -249,8 +251,14 @@ public class IdxBizPvHealthIndexController extends BaseController {
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
return ResponseHelper.buildResponse(fanHealthIndexDays); int total = pvHealthIndexDayMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(fanHealthIndexDays);
page.setTotal(total);
return ResponseHelper.buildResponse(page);
}else if (requiredType.equals("按小时")){ }else if (requiredType.equals("按小时")){
int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY); int hour = Calendar.getInstance().get(Calendar.HOUR_OF_DAY);
String day = DateUtils.getDateNowShortStr(); String day = DateUtils.getDateNowShortStr();
...@@ -263,15 +271,28 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -263,15 +271,28 @@ public class IdxBizPvHealthIndexController extends BaseController {
e.printStackTrace(); e.printStackTrace();
} }
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
return ResponseHelper.buildResponse(fanHealthIndexHours); int total = pvHealthIndexHourMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(fanHealthIndexHours);
page.setTotal(total);
return ResponseHelper.buildResponse(page);
}else { }else {
Date date = DateUtils.dateAddMinutes(null,-9); Date date = DateUtils.dateAddMinutes(null,-9);
date = DateUtils.dateAddHours(date, -8); date = DateUtils.dateAddHours(date, -8);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
startTimeTop = formatter.format(date); startTimeTop = formatter.format(date);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
return ResponseHelper.buildResponse(fanHealthIndexMoments); Page page = new Page<>();
page.setCurrent(current);
page.setSize(size);
page.setRecords(fanHealthIndexMoments);
int total = pvHealthIndexMomentMapper.selectDataTotal(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop);
page.setTotal(total);
return ResponseHelper.buildResponse(page);
} }
} }
...@@ -291,6 +312,8 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -291,6 +312,8 @@ public class IdxBizPvHealthIndexController extends BaseController {
@RequestParam(value = "healthLevel",required = false) String healthLevel, @RequestParam(value = "healthLevel",required = false) String healthLevel,
@RequestParam(value = "type",required = false) String type, @RequestParam(value = "type",required = false) String type,
@RequestParam(value = "requiredType",required = false) String requiredType, @RequestParam(value = "requiredType",required = false) String requiredType,
@RequestParam(value = "current",required = false) Integer current,
@RequestParam(value = "size",required = false) Integer size,
@RequestParam(value = "subarray",required = false) String subarray) { @RequestParam(value = "subarray",required = false) String subarray) {
Map<String,Object> result = new HashMap<>(); Map<String,Object> result = new HashMap<>();
...@@ -306,7 +329,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -306,7 +329,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexDay> fanHealthIndexDays = pvHealthIndexDayMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,(current-1)*size,size);
fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexDays= fanHealthIndexDays.stream().sorted(Comparator.comparing(PvHealthIndexDay::getAnalysisTime)).collect(Collectors.toList());
for (PvHealthIndexDay obj : fanHealthIndexDays) { for (PvHealthIndexDay obj : fanHealthIndexDays) {
...@@ -328,7 +351,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -328,7 +351,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
} }
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexHour> fanHealthIndexHours = pvHealthIndexHourMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null);
fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexHours= fanHealthIndexHours.stream().sorted(Comparator.comparing(PvHealthIndexHour::getAnalysisTime)).collect(Collectors.toList());
for (PvHealthIndexHour obj : fanHealthIndexHours) { for (PvHealthIndexHour obj : fanHealthIndexHours) {
if (type.equals("0")){ if (type.equals("0")){
...@@ -350,7 +373,7 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -350,7 +373,7 @@ public class IdxBizPvHealthIndexController extends BaseController {
Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8); Date startDate = DateUtils.dateAddHours(DateUtils.longStr2Date(startTimeTop), -8);
startTimeTop = formatter.format(startDate); startTimeTop = formatter.format(startDate);
List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop); List<PvHealthIndexMoment> fanHealthIndexMoments = pvHealthIndexMomentMapper.selectData(healthLevel, area, equipmentName, subarray, analysisType, analysisObjType, station, pointName, indexAddress, startTimeTop, endTimeTop,null,null);
fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(PvHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList()); fanHealthIndexMoments= fanHealthIndexMoments.stream().sorted(Comparator.comparing(PvHealthIndexMoment::getAnalysisTime)).collect(Collectors.toList());
for (PvHealthIndexMoment obj : fanHealthIndexMoments) { for (PvHealthIndexMoment obj : fanHealthIndexMoments) {
if (type.equals("0")){ if (type.equals("0")){
...@@ -400,10 +423,15 @@ public class IdxBizPvHealthIndexController extends BaseController { ...@@ -400,10 +423,15 @@ public class IdxBizPvHealthIndexController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false) @TycloudOperation(ApiLevel = UserType.AGENCY,needAuth = false)
@GetMapping(value = "/selectWarningPoint") @GetMapping(value = "/selectWarningPoint")
@ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表") @ApiOperation(httpMethod = "GET", value = "预警监测设备右侧预警重复列表", notes = "预警监测设备右侧预警重复列表")
public ResponseModel<List<PvWarningRecord>> selectFanWarningNum(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam String SUBARRAY) { public ResponseModel<Page<PvWarningRecord>> selectFanWarningNum(@RequestParam String STATION,@RequestParam String EQUIPMENTNAME,@RequestParam String SUBARRAY,Integer current,Integer size) {
List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,SUBARRAY); Page<PvWarningRecord> page = new Page<>();
page.setCurrent(current);
return ResponseHelper.buildResponse(maps); page.setSize(size);
List<PvWarningRecord> maps = pvWaringRecordMapper.selectWarningPoint(STATION,EQUIPMENTNAME,SUBARRAY,(current-1)*size,size);
page.setRecords(maps);
int total = pvWaringRecordMapper.selectWarningPointTotal(STATION, EQUIPMENTNAME,SUBARRAY);
page.setTotal(total);
return ResponseHelper.buildResponse(page);
} }
......
...@@ -29,6 +29,21 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> { ...@@ -29,6 +29,21 @@ public interface FanHealthIndexDayMapper extends BaseMapper<FanHealthIndexDay> {
@Select("<script>"+ @Select("<script>"+
"SELECT count(1) FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null'> AND area = #{area} </if> " +
"<if test='indexAddress!= null'> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null'>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null'>AND health_level = #{healthLevel} </if>" +
"<if test='subSystem!= null'>AND sub_system = #{subSystem} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("equipmentName")String equipmentName,@Param("subSystem")String subSystem,@Param("analysisType")String analysisType,@Param("analysisObjType")String analysisObjType,@Param("station")String station,@Param("pointName")String pointName, @Param("indexAddress")String indexAddress,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop);
@Select("<script>"+
"SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" + "SELECT station, health_level as healthlevel,( CASE HEALTH_LEVEL WHEN '危险' THEN 4 WHEN '警告' THEN 3 WHEN '注意' THEN 2 ELSE 1 END ) AS sort, count( 1 ) AS `value` FROM analysis_data.fan_health_index_day WHERE analysis_obj_type = #{analysisObjType} AND ts >= TODAY()-8h" +
"<if test='area!= null'> AND area = #{area} </if> " + "<if test='area!= null'> AND area = #{area} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" + "<if test='station!= null'>AND station = #{station} </if>" +
......
...@@ -19,7 +19,8 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> { ...@@ -19,7 +19,8 @@ public interface FanWaringRecordMapper extends BaseMapper<FanWarningRecord> {
public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM); public List<FanWarningRecord> warningData(String STATION,String EQUIPMENTNAME,String SUBSYSTEM);
public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME); public List<FanWarningRecord> selectWarningPoint(String STATION,String EQUIPMENTNAME,Integer current,Integer size);
public int selectWarningPointTotal(String STATION,String EQUIPMENTNAME);
public List<Map<String,Object>> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME); public List<Map<String,Object>> selectEquipWarningTotal(String STATION,String EQUIPMENTNAME);
......
...@@ -21,7 +21,26 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> { ...@@ -21,7 +21,26 @@ public interface PvHealthIndexDayMapper extends BaseMapper<PvHealthIndexDay> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>") "</script>")
List<PvHealthIndexDay> selectData(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName); List<PvHealthIndexDay> selectData(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName
, @Param("current")Integer current, @Param("size")Integer size);
@Select("<script>"+
"SELECT count(1)" +
" FROM analysis_data.pv_health_index_day WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"</script>")
int selectDataTotal(@Param("station")String station,@Param("analysisType")String analysisType,@Param("indexAddress")String indexAddress,@Param("healthLevel")String healthLevel,@Param("area")String area,@Param("analysisObjType")String analysisObjType, @Param("subarray")String subarray, @Param("pointName")String pointName,@Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop, @Param("equipmentName")String equipmentName);
} }
...@@ -21,7 +21,24 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> { ...@@ -21,7 +21,24 @@ public interface PvHealthIndexHourMapper extends BaseMapper<PvHealthIndexHour> {
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>") "</script>")
List<PvHealthIndexHour> selectData (@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop); List<PvHealthIndexHour> selectData (@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop
, @Param("current")Integer current, @Param("size")Integer size);
@Select("<script>"+
"SELECT count(1)" +
" FROM analysis_data.pv_health_index_hour WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop);
} }
...@@ -21,6 +21,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen ...@@ -21,6 +21,25 @@ public interface PvHealthIndexMomentMapper extends BaseMapper<PvHealthIndexMomen
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" + "<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " + "<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" + "<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"order by health_index "+
"<if test='current != null and size != null'>limit ${current},${size} </if>" +
"</script>") "</script>")
List<PvHealthIndexMoment> selectData(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop); List<PvHealthIndexMoment> selectData(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop
, @Param("current")Integer current, @Param("size")Integer size);;
@Select("<script>"+
"SELECT count(1)" +
" FROM analysis_data.pv_health_index_moment WHERE analysis_obj_type = #{analysisObjType}" +
"<if test='endTimeTop!= null'> and ts &lt;= #{endTimeTop} </if> " +
"<if test='startTimeTop!= null'> and ts &gt;= #{startTimeTop} </if> " +
"<if test='area!= null '> AND area = #{area} </if> " +
"<if test='indexAddress!= null '> AND index_address = #{indexAddress} </if> " +
"<if test='pointName!= null '>AND point_name = #{pointName} </if> " +
"<if test='station!= null'>AND station = #{station} </if>" +
"<if test='healthLevel!= null '>AND health_level = #{healthLevel} </if>" +
"<if test='subarray!= null'>AND subarray = #{subarray} </if> " +
"<if test='equipmentName!= null'>AND equipment_name = #{equipmentName} </if>" +
"</script>")
int selectDataTotal(@Param("healthLevel")String healthLevel, @Param("area")String area, @Param("equipmentName")String equipmentName, @Param("subarray")String subarray, @Param("analysisType")String analysisType, @Param("analysisObjType")String analysisObjType, @Param("station")String station, @Param("pointName")String pointName, @Param("indexAddress")String indexAddress, @Param("startTimeTop") String startTimeTop, @Param("endTimeTop")String endTimeTop);
} }
...@@ -17,7 +17,8 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> { ...@@ -17,7 +17,8 @@ public interface PvWaringRecordMapper extends BaseMapper<PvWarningRecord> {
public List<Map<String,Object>> selectFanWarningNum(String station); public List<Map<String,Object>> selectFanWarningNum(String station);
List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY); List<PvWarningRecord> selectWarningPoint(String STATION, String EQUIPMENTNAME, String SUBARRAY,Integer current,Integer size);
int selectWarningPointTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY);
List<Map<String, Object>> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY); List<Map<String, Object>> selectEquipWarningTotal(String STATION, String EQUIPMENTNAME, String SUBARRAY);
......
...@@ -135,6 +135,35 @@ ...@@ -135,6 +135,35 @@
rec_date , rec_date ,
content, content,
warning_name warning_name
limit #{current},#{size}
</select>
<select id="selectWarningPointTotal" resultType="int">
select count(1) from (SELECT
a.station,
a.warning_name,
a.content,
a.equipment_name,
a.point_name,
a.rec_date
from
analysis_data.fan_warning_record a
where
a.status = 0
<if test="STATION != null and STATION != '' ">
AND a.station = #{STATION}
</if>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND a.equipment_name = #{EQUIPMENTNAME}
</if>
group by
station,
equipment_name,
point_name,
rec_date ,
content,
warning_name) b
</select> </select>
<select id="selectEquipWarningTotal" resultType="map"> <select id="selectEquipWarningTotal" resultType="map">
......
...@@ -147,9 +147,40 @@ ...@@ -147,9 +147,40 @@
rec_date , rec_date ,
content, content,
warning_name warning_name
limit #{current},#{size}
</select> </select>
<select id="selectWarningPointTotal" resultType="int">
SELECT
a.station,
a.warning_name,
a.content,
a.equipment_name,
a.point_name,
a.rec_date
from
analysis_data.pv_warning_record a
where
a.status = 0
<if test="STATION != null and STATION != '' ">
AND a.station = #{STATION}
</if>
<if test="EQUIPMENTNAME != '' and EQUIPMENTNAME != null">
AND a.equipment_name = #{EQUIPMENTNAME}
</if>
<if test="SUBARRAY != '' and SUBARRAY != null">
AND a.subarray = #{SUBARRAY}
</if>
group by
station,
equipment_name,
point_name,
rec_date ,
content,
warning_name
</select>
<select id="selectEquipWarningTotal" resultType="map"> <select id="selectEquipWarningTotal" resultType="map">
SELECT SELECT
`STATION` AS `STATION`, `STATION` AS `STATION`,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment