From 7b2efe8b35c9f98e32a57425f79f2ffd0fe26246 Mon Sep 17 00:00:00 2001 From: wangshilong Date: Fri, 28 Feb 2025 22:47:43 +0800 Subject: [PATCH] =?UTF-8?q?mi=5Fweps=E6=9F=A5=E8=AF=A2=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/isu/gaswellwatch/dao/DeviceDao.java | 2 +- .../gaswellwatch/service/DeviceService.java | 2 +- .../service/impl/DeviceServiceImpl.java | 4 +- .../service/impl/SummaryServiceImpl.java | 2 +- src/main/resources/mapper/DeviceDao.xml | 45 +++++++++++++------ 5 files changed, 37 insertions(+), 18 deletions(-) diff --git a/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java b/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java index d1f49d5..e9f958e 100644 --- a/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java +++ b/src/main/java/com/isu/gaswellwatch/dao/DeviceDao.java @@ -44,7 +44,7 @@ public interface DeviceDao extends BaseMapper { List getDeviceVOByIds(@Param("idList") List deviceIdList); - List getPressureChartData(Long deviceId, String startTime, String endTime, String tableName); + List getPressureChartData(Long deviceId, String startTime, String endTime, String tableName, String deviceProduct); List getSwitchStatusData(Long deviceId, String startTime, String endTime, String tableName, String deviceProduct); diff --git a/src/main/java/com/isu/gaswellwatch/service/DeviceService.java b/src/main/java/com/isu/gaswellwatch/service/DeviceService.java index bc173fc..aa60d92 100644 --- a/src/main/java/com/isu/gaswellwatch/service/DeviceService.java +++ b/src/main/java/com/isu/gaswellwatch/service/DeviceService.java @@ -37,7 +37,7 @@ public interface DeviceService extends IService { List getDeviceVOByIds(List deviceIdList); - List getPressureChartData(Long deviceId, String startTime, String endTime); + List getPressureChartData(Long deviceId, String startTime, String endTime, String deviceProduct); List getSwitchStatusData(Long deviceId, String startTime, String endTime, String deviceProduct); diff --git a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java index 6cdcb9e..102e155 100644 --- a/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java +++ b/src/main/java/com/isu/gaswellwatch/service/impl/DeviceServiceImpl.java @@ -282,9 +282,9 @@ public class DeviceServiceImpl extends ServiceImpl implements } @Override - public List getPressureChartData(Long deviceId, String startTime, String endTime) { + public List getPressureChartData(Long deviceId, String startTime, String endTime, String deviceProduct) { String tableName = Redis2DBPersistenceService.DEFAULT_DATA_TABLE + deviceId; - return this.deviceDao.getPressureChartData(deviceId, startTime, endTime, tableName); + return this.deviceDao.getPressureChartData(deviceId, startTime, endTime, tableName, deviceProduct); } @Override diff --git a/src/main/java/com/isu/gaswellwatch/service/impl/SummaryServiceImpl.java b/src/main/java/com/isu/gaswellwatch/service/impl/SummaryServiceImpl.java index 404be94..e7c8557 100644 --- a/src/main/java/com/isu/gaswellwatch/service/impl/SummaryServiceImpl.java +++ b/src/main/java/com/isu/gaswellwatch/service/impl/SummaryServiceImpl.java @@ -101,7 +101,7 @@ public class SummaryServiceImpl implements SummaryService { } List xAxisData = new ArrayList<>(); - List dataList = this.deviceService.getPressureChartData(deviceId, startTime, endTime); + List dataList = this.deviceService.getPressureChartData(deviceId, startTime, endTime, deviceVO.getProduct().getCode()); //将查询到的结果组装成LineSummaryVO返回给前端 LineSummaryVO lineSummaryVO = new LineSummaryVO(); lineSummaryVO.setTitle(deviceVO.getGasWell().getName()); diff --git a/src/main/resources/mapper/DeviceDao.xml b/src/main/resources/mapper/DeviceDao.xml index a0a68da..eb7517c 100644 --- a/src/main/resources/mapper/DeviceDao.xml +++ b/src/main/resources/mapper/DeviceDao.xml @@ -97,27 +97,28 @@ - select t.collection_time,t.oil_pressure,t.cas_pressure,t.pre_pressure + select t.collection_time,t.oil_pressure,t.cas_pressure - ,'knpc' as type,t.run_mode,t.status_end_time,t.temperature,t.humidity,t.well_status,t.plug_status + ,t.pre_pressure,'knpc' as + type,t.run_mode,t.status_end_time,t.temperature,t.humidity,t.well_status,t.plug_status - ,'etc' as type,t.current_status_remaining_time as statusEndTime + ,t.pre_pressure,'etc' as type,t.current_status_remaining_time as statusEndTime ,t.controller_current_status as runMode,t.solenoid_valve_status as wellStatus - ,'scss' as type,t.ctl_model as runMode,t.remaining_time_action as statusEndTime + ,t.pre_pressure,'scss' as type,t.ctl_model as runMode,t.remaining_time_action as statusEndTime ,t.solar_voltage,t.first_solenoid_status as wellStatus - ,'weps_plug' as type, t.run_mode as runMode + ,t.pre_pressure,'weps_plug' as type, t.run_mode as runMode ,case t.solenoid_valve_status when 2 then t.open_well_remaining_time when 1 then t.close_well_remaining_time else null end as statusEndTime ,case t.solenoid_valve_status when 2 then 1 when 1 then 0 else null end as wellStatus - ,t.produce_mode as runMode,t.remaining_time as statusEndTime + ,'mi_weps_plug' as type,t.produce_mode as runMode,t.remaining_time as statusEndTime ,case t.current_status when 0 then 0 else 1 end as wellStatus ,t.current_status as plugStatus