|
@@ -1,7 +1,6 @@
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
<mapper namespace="com.energy.manage.analyse.mappers.anomaly.AnomalyWindfarmMapper">
|
|
<mapper namespace="com.energy.manage.analyse.mappers.anomaly.AnomalyWindfarmMapper">
|
|
|
-
|
|
|
|
|
<!-- 所有风场健康情况信息查询 -->
|
|
<!-- 所有风场健康情况信息查询 -->
|
|
|
<select id="getAnomalyListByFieldIds" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyRegionVO">
|
|
<select id="getAnomalyListByFieldIds" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyRegionVO">
|
|
|
select
|
|
select
|
|
@@ -9,10 +8,12 @@
|
|
|
from anomaly_windfarm
|
|
from anomaly_windfarm
|
|
|
where 1=1
|
|
where 1=1
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="fieldIds != null and fieldIds.size() > 0">
|
|
<if test="fieldIds != null and fieldIds.size() > 0">
|
|
|
and field_id in
|
|
and field_id in
|
|
@@ -21,14 +22,29 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
<!-- 查询风机异常统计数 -->
|
|
<!-- 查询风机异常统计数 -->
|
|
|
<select id="selectAnomalyWindfarmAndFieldId" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyOverviewVO">
|
|
<select id="selectAnomalyWindfarmAndFieldId" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyOverviewVO">
|
|
|
select
|
|
select
|
|
|
field_id as fieldId,
|
|
field_id as fieldId,
|
|
|
result_anomaly_count as totalAnomalyCount,
|
|
result_anomaly_count as totalAnomalyCount,
|
|
|
sensor_anomaly_count as sensorAnomalyCount,
|
|
sensor_anomaly_count as sensorAnomalyCount,
|
|
|
- anomaly_detection_count as detectorAnomalyCount
|
|
|
|
|
|
|
+ anomaly_detection_count as detectorAnomalyCount,
|
|
|
|
|
+
|
|
|
|
|
+ model1_windpwr_powercurve_graph as model1WindpwrPowercurveGraph,
|
|
|
|
|
+ model1_windpwr_scatter_graph as model1WindpwrScatterGraph,
|
|
|
|
|
+ model2_yaw_staticyaw_graph as model2YawStaticyawGraph,
|
|
|
|
|
+ model2_yaw_cabletwist_graph as model2YawCabletwistGraph,
|
|
|
|
|
+ model2_yaw_yawerror_graph as model2YawYawerrorGraph,
|
|
|
|
|
+ model2_yaw_yawcount_graph as model2YawYawcountGraph,
|
|
|
|
|
+ model3_pitch_pitchcoord_graph as model3PitchPitchcoordGraph,
|
|
|
|
|
+ model3_pitch_pitchregulation_graph as model3PitchPitchregulationGraph,
|
|
|
|
|
+ model3_pitch_minpitch_graph as model3PitchMinpitchGraph,
|
|
|
|
|
+ model4_ctrlparam_powerquality_graph as model4CtrlparamPowerqualityGraph,
|
|
|
|
|
+ model4_ctrlparam_operationstate_graph as model4CtrlparamOperationstateGraph,
|
|
|
|
|
+ model4_ctrlparam_deload_graph as model4CtrlparamDeloadGraph,
|
|
|
|
|
+ model5_aerodynamics_cp_graph as model5AerodynamicsCpGraph,
|
|
|
|
|
+ model5_aerodynamics_tsr_graph as model5AerodynamicsTsrGraph,
|
|
|
|
|
+ model5_aerodynamics_cp_tsr_graph as model5AerodynamicsCpTsrGraph
|
|
|
from
|
|
from
|
|
|
anomaly_windfarm
|
|
anomaly_windfarm
|
|
|
where 1=1
|
|
where 1=1
|
|
@@ -42,13 +58,14 @@
|
|
|
</foreach>
|
|
</foreach>
|
|
|
</if>
|
|
</if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
<!-- 柱状图 -->
|
|
<!-- 柱状图 -->
|
|
|
<select id="selectAnomalyModelCount" resultType="com.energy.manage.analyse.domain.vo.anomaly.BarChartVO">
|
|
<select id="selectAnomalyModelCount" resultType="com.energy.manage.analyse.domain.vo.anomaly.BarChartVO">
|
|
|
SELECT
|
|
SELECT
|
|
@@ -63,20 +80,20 @@
|
|
|
field_id = #{fieldId}
|
|
field_id = #{fieldId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
<!-- 异常检测模块 -->
|
|
<!-- 异常检测模块 -->
|
|
|
<resultMap id="AnomalyModelResultMap" type="com.energy.manage.analyse.po.anomaly.AnomalyModelPO">
|
|
<resultMap id="AnomalyModelResultMap" type="com.energy.manage.analyse.po.anomaly.AnomalyModelPO">
|
|
|
<id property="id" column="id"/>
|
|
<id property="id" column="id"/>
|
|
|
<result property="fieldId" column="field_id"/>
|
|
<result property="fieldId" column="field_id"/>
|
|
|
<result property="engineId" column="engine_id"/>
|
|
<result property="engineId" column="engine_id"/>
|
|
|
<result property="machineTypeCode" column="machine_type_code"/>
|
|
<result property="machineTypeCode" column="machine_type_code"/>
|
|
|
-
|
|
|
|
|
<result column="sensor_anomaly_power" property="sensorAnomalyPower" jdbcType="INTEGER"/>
|
|
<result column="sensor_anomaly_power" property="sensorAnomalyPower" jdbcType="INTEGER"/>
|
|
|
<result column="sensor_anomaly_power_ratio" property="sensorAnomalyPowerRatio" jdbcType="DECIMAL"/>
|
|
<result column="sensor_anomaly_power_ratio" property="sensorAnomalyPowerRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="sensor_anomaly_wind" property="sensorAnomalyWind" jdbcType="INTEGER"/>
|
|
<result column="sensor_anomaly_wind" property="sensorAnomalyWind" jdbcType="INTEGER"/>
|
|
@@ -91,7 +108,6 @@
|
|
|
<result column="sensor_anomaly_wind_pwr_ratio" property="sensorAnomalyWindPwrRatio" jdbcType="DECIMAL"/>
|
|
<result column="sensor_anomaly_wind_pwr_ratio" property="sensorAnomalyWindPwrRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="sensor_anomaly_spd_trq" property="sensorAnomalySpdTrq" jdbcType="INTEGER"/>
|
|
<result column="sensor_anomaly_spd_trq" property="sensorAnomalySpdTrq" jdbcType="INTEGER"/>
|
|
|
<result column="sensor_anomaly_spd_trq_ratio" property="sensorAnomalySpdTrqRatio" jdbcType="DECIMAL"/>
|
|
<result column="sensor_anomaly_spd_trq_ratio" property="sensorAnomalySpdTrqRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
<result column="model1_windpwr_is_anomaly" property="model1WindpwrIsAnomaly" jdbcType="INTEGER"/>
|
|
<result column="model1_windpwr_is_anomaly" property="model1WindpwrIsAnomaly" jdbcType="INTEGER"/>
|
|
|
<result column="model1_windpwr_normal_count" property="model1WindpwrNormalCount" jdbcType="INTEGER"/>
|
|
<result column="model1_windpwr_normal_count" property="model1WindpwrNormalCount" jdbcType="INTEGER"/>
|
|
|
<result column="model1_windpwr_anomaly_count" property="model1WindpwrAnomalyCount" jdbcType="INTEGER"/>
|
|
<result column="model1_windpwr_anomaly_count" property="model1WindpwrAnomalyCount" jdbcType="INTEGER"/>
|
|
@@ -101,7 +117,6 @@
|
|
|
<result column="model1_windpwr_scatter" property="model1WindpwrScatter" jdbcType="INTEGER"/>
|
|
<result column="model1_windpwr_scatter" property="model1WindpwrScatter" jdbcType="INTEGER"/>
|
|
|
<result column="model1_windpwr_scatter_ratio" property="model1WindpwrScatterRatio" jdbcType="DECIMAL"/>
|
|
<result column="model1_windpwr_scatter_ratio" property="model1WindpwrScatterRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model1_windpwr_simulink" property="model1WindpwrSimulink" jdbcType="INTEGER"/>
|
|
<result column="model1_windpwr_simulink" property="model1WindpwrSimulink" jdbcType="INTEGER"/>
|
|
|
-
|
|
|
|
|
<result column="model2_yaw_is_anomaly" property="model2YawIsAnomaly" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_is_anomaly" property="model2YawIsAnomaly" jdbcType="INTEGER"/>
|
|
|
<result column="model2_yaw_normal_count" property="model2YawNormalCount" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_normal_count" property="model2YawNormalCount" jdbcType="INTEGER"/>
|
|
|
<result column="model2_yaw_anomaly_count" property="model2YawAnomalyCount" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_anomaly_count" property="model2YawAnomalyCount" jdbcType="INTEGER"/>
|
|
@@ -110,7 +125,6 @@
|
|
|
<result column="model2_yaw_staticyaw_ratio" property="model2YawStaticyawRatio" jdbcType="DECIMAL"/>
|
|
<result column="model2_yaw_staticyaw_ratio" property="model2YawStaticyawRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model2_yaw_cabletwist" property="model2YawCabletwist" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_cabletwist" property="model2YawCabletwist" jdbcType="INTEGER"/>
|
|
|
<result column="model2_yaw_cabletwist_ratio" property="model2YawCabletwistRatio" jdbcType="DECIMAL"/>
|
|
<result column="model2_yaw_cabletwist_ratio" property="model2YawCabletwistRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
<result column="model3_pitch_is_anomaly" property="model3PitchIsAnomaly" jdbcType="INTEGER"/>
|
|
<result column="model3_pitch_is_anomaly" property="model3PitchIsAnomaly" jdbcType="INTEGER"/>
|
|
|
<result column="model3_pitch_normal_count" property="model3PitchNormalCount" jdbcType="INTEGER"/>
|
|
<result column="model3_pitch_normal_count" property="model3PitchNormalCount" jdbcType="INTEGER"/>
|
|
|
<result column="model3_pitch_anomaly_count" property="model3PitchAnomalyCount" jdbcType="INTEGER"/>
|
|
<result column="model3_pitch_anomaly_count" property="model3PitchAnomalyCount" jdbcType="INTEGER"/>
|
|
@@ -119,7 +133,6 @@
|
|
|
<result column="model3_pitch_pitchregulation_ratio" property="model3PitchPitchregulationRatio" jdbcType="DECIMAL"/>
|
|
<result column="model3_pitch_pitchregulation_ratio" property="model3PitchPitchregulationRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model3_pitch_pitchcoord" property="model3PitchPitchcoord" jdbcType="INTEGER"/>
|
|
<result column="model3_pitch_pitchcoord" property="model3PitchPitchcoord" jdbcType="INTEGER"/>
|
|
|
<result column="model3_pitch_pitchcoord_ratio" property="model3PitchPitchcoordRatio" jdbcType="DECIMAL"/>
|
|
<result column="model3_pitch_pitchcoord_ratio" property="model3PitchPitchcoordRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
<result column="model4_is_anomaly" property="model4IsAnomaly" jdbcType="INTEGER"/>
|
|
<result column="model4_is_anomaly" property="model4IsAnomaly" jdbcType="INTEGER"/>
|
|
|
<result column="model4_ctrlparam_normal_count" property="model4CtrlparamNormalCount" jdbcType="INTEGER"/>
|
|
<result column="model4_ctrlparam_normal_count" property="model4CtrlparamNormalCount" jdbcType="INTEGER"/>
|
|
|
<result column="model4_ctrlparam_anomaly_count" property="model4CtrlparamAnomalyCount" jdbcType="INTEGER"/>
|
|
<result column="model4_ctrlparam_anomaly_count" property="model4CtrlparamAnomalyCount" jdbcType="INTEGER"/>
|
|
@@ -130,7 +143,6 @@
|
|
|
<result column="model4_ctrlparam_deload_ratio" property="model4CtrlparamDeloadRatio" jdbcType="DECIMAL"/>
|
|
<result column="model4_ctrlparam_deload_ratio" property="model4CtrlparamDeloadRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model4_ctrlparam_operationstate" property="model4CtrlparamOperationstate" jdbcType="INTEGER"/>
|
|
<result column="model4_ctrlparam_operationstate" property="model4CtrlparamOperationstate" jdbcType="INTEGER"/>
|
|
|
<result column="model4_ctrlparam_operationstate_ratio" property="model4CtrlparamOperationstateRatio" jdbcType="DECIMAL"/>
|
|
<result column="model4_ctrlparam_operationstate_ratio" property="model4CtrlparamOperationstateRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
<result column="model5_is_anomaly" property="model5IsAnomaly" jdbcType="INTEGER"/>
|
|
<result column="model5_is_anomaly" property="model5IsAnomaly" jdbcType="INTEGER"/>
|
|
|
<result column="model5_aerodynamics_normal_count" property="model5AerodynamicsNormalCount" jdbcType="INTEGER"/>
|
|
<result column="model5_aerodynamics_normal_count" property="model5AerodynamicsNormalCount" jdbcType="INTEGER"/>
|
|
|
<result column="model5_aerodynamics_anomaly_count" property="model5AerodynamicsAnomalyCount" jdbcType="INTEGER"/>
|
|
<result column="model5_aerodynamics_anomaly_count" property="model5AerodynamicsAnomalyCount" jdbcType="INTEGER"/>
|
|
@@ -141,21 +153,17 @@
|
|
|
<result column="model5_aerodynamics_tsr_ratio" property="model5AerodynamicsTsrRatio" jdbcType="DECIMAL"/>
|
|
<result column="model5_aerodynamics_tsr_ratio" property="model5AerodynamicsTsrRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model5_aerodynamics_cp_tsr" property="model5AerodynamicsCpTsr" jdbcType="INTEGER"/>
|
|
<result column="model5_aerodynamics_cp_tsr" property="model5AerodynamicsCpTsr" jdbcType="INTEGER"/>
|
|
|
<result column="model5_aerodynamics_cp_tsr_ratio" property="model5AerodynamicsCpTsrRatio" jdbcType="DECIMAL"/>
|
|
<result column="model5_aerodynamics_cp_tsr_ratio" property="model5AerodynamicsCpTsrRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <result column="sensor_anomaly_freeze" property="sensorAnomalyFreeze" jdbcType="INTEGER"/>
|
|
|
|
|
- <result column="sensor_anomaly_freeze_ratio" property="sensorAnomalyFreezeRatio" jdbcType="DECIMAL"/>
|
|
|
|
|
|
|
+ <result column="sensor_anomaly_yaw" property="sensorAnomalyFreeze" jdbcType="INTEGER"/>
|
|
|
|
|
+ <result column="sensor_anomaly_yaw_ratio" property="sensorAnomalyFreezeRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model2_yaw_yawerror" property="model2YawYawerror" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_yawerror" property="model2YawYawerror" jdbcType="INTEGER"/>
|
|
|
- <result column="model2_yaw_yawerror_ratio" property="model2YawYawerrorRatio" jdbcType="DECIMAL"/>
|
|
|
|
|
|
|
+ <result column="model2_yaw_yawerror_ratio" property="model2YawYawerrorRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model2_yaw_yawcount" property="model2YawYawcount" jdbcType="INTEGER"/>
|
|
<result column="model2_yaw_yawcount" property="model2YawYawcount" jdbcType="INTEGER"/>
|
|
|
- <result column="model2_yaw_yawcount_ratio" property="model2YawYawcountRatio" jdbcType="DECIMAL"/>
|
|
|
|
|
|
|
+ <result column="model2_yaw_yawcount_ratio" property="model2YawYawcountRatio" jdbcType="DECIMAL"/>
|
|
|
<result column="model3_pitch_minpitch" property="model3PitchMinpitch" jdbcType="INTEGER"/>
|
|
<result column="model3_pitch_minpitch" property="model3PitchMinpitch" jdbcType="INTEGER"/>
|
|
|
<result column="model3_pitch_minpitch_ratio" property="model3PitchMinpitchRatio" jdbcType="DECIMAL"/>
|
|
<result column="model3_pitch_minpitch_ratio" property="model3PitchMinpitchRatio" jdbcType="DECIMAL"/>
|
|
|
-
|
|
|
|
|
<result property="sourceDatetime" column="source_datetime"/>
|
|
<result property="sourceDatetime" column="source_datetime"/>
|
|
|
<result property="createTime" column="create_time"/>
|
|
<result property="createTime" column="create_time"/>
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
-
|
|
|
|
|
<!-- 查询所有记录 -->
|
|
<!-- 查询所有记录 -->
|
|
|
<select id="selectAllAnomalyModel" resultMap="AnomalyModelResultMap">
|
|
<select id="selectAllAnomalyModel" resultMap="AnomalyModelResultMap">
|
|
|
SELECT
|
|
SELECT
|
|
@@ -223,8 +231,8 @@
|
|
|
model5_aerodynamics_cp_tsr,
|
|
model5_aerodynamics_cp_tsr,
|
|
|
model5_aerodynamics_cp_tsr_ratio,
|
|
model5_aerodynamics_cp_tsr_ratio,
|
|
|
|
|
|
|
|
- sensor_anomaly_freeze,
|
|
|
|
|
- sensor_anomaly_freeze_ratio,
|
|
|
|
|
|
|
+ sensor_anomaly_yaw,
|
|
|
|
|
+ sensor_anomaly_yaw_ratio,
|
|
|
model2_yaw_yawerror,
|
|
model2_yaw_yawerror,
|
|
|
model2_yaw_yawerror_ratio,
|
|
model2_yaw_yawerror_ratio,
|
|
|
model2_yaw_yawcount,
|
|
model2_yaw_yawcount,
|
|
@@ -240,14 +248,14 @@
|
|
|
field_id = #{fieldId}
|
|
field_id = #{fieldId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<!-- 基础结果映射 -->
|
|
<!-- 基础结果映射 -->
|
|
|
<resultMap id="BaseResultMap" type="com.energy.manage.analyse.po.anomaly.BaseAnomalyDetectorPO">
|
|
<resultMap id="BaseResultMap" type="com.energy.manage.analyse.po.anomaly.BaseAnomalyDetectorPO">
|
|
|
<id column="id" property="id" />
|
|
<id column="id" property="id" />
|
|
@@ -267,7 +275,6 @@
|
|
|
<result column="create_time" property="createTime" />
|
|
<result column="create_time" property="createTime" />
|
|
|
<result column="detector_anomaly_rate" property="detectorAnomalyRate" />
|
|
<result column="detector_anomaly_rate" property="detectorAnomalyRate" />
|
|
|
</resultMap>
|
|
</resultMap>
|
|
|
-
|
|
|
|
|
<!-- 动态查询模块检测器 -->
|
|
<!-- 动态查询模块检测器 -->
|
|
|
<select id="selectAnomalyDetectorAll" resultMap="BaseResultMap">
|
|
<select id="selectAnomalyDetectorAll" resultMap="BaseResultMap">
|
|
|
SELECT * FROM
|
|
SELECT * FROM
|
|
@@ -280,14 +287,14 @@
|
|
|
and engine_id = #{engineId}
|
|
and engine_id = #{engineId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
<!-- ======================================== 子页面曲线图 ======================================== -->
|
|
<!-- ======================================== 子页面曲线图 ======================================== -->
|
|
|
<!-- 1. 单表统计:指定年度表 -->
|
|
<!-- 1. 单表统计:指定年度表 -->
|
|
|
<select id="selectBySingleTable" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyDailyVO">
|
|
<select id="selectBySingleTable" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyDailyVO">
|
|
@@ -320,7 +327,6 @@
|
|
|
and source_datetime BETWEEN #{startDate} AND #{endDate}
|
|
and source_datetime BETWEEN #{startDate} AND #{endDate}
|
|
|
ORDER BY create_time ASC
|
|
ORDER BY create_time ASC
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
<!-- 2. 跨表统计:跨年两张表 UNION ALL 合并(核心!) -->
|
|
<!-- 2. 跨表统计:跨年两张表 UNION ALL 合并(核心!) -->
|
|
|
<select id="selectByUnionTables" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyDailyVO">
|
|
<select id="selectByUnionTables" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyDailyVO">
|
|
|
SELECT
|
|
SELECT
|
|
@@ -344,7 +350,6 @@
|
|
|
and source_datetime BETWEEN #{startDate} AND #{endDate}
|
|
and source_datetime BETWEEN #{startDate} AND #{endDate}
|
|
|
|
|
|
|
|
UNION ALL
|
|
UNION ALL
|
|
|
-
|
|
|
|
|
<!-- 第二张表 -->
|
|
<!-- 第二张表 -->
|
|
|
SELECT
|
|
SELECT
|
|
|
create_time AS createTime,
|
|
create_time AS createTime,
|
|
@@ -360,7 +365,6 @@
|
|
|
) AS union_data
|
|
) AS union_data
|
|
|
ORDER BY date ASC
|
|
ORDER BY date ASC
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
<select id="selectAnomalySensorCountVO" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalySensorCountVO">
|
|
<select id="selectAnomalySensorCountVO" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalySensorCountVO">
|
|
|
|
|
|
|
|
SELECT
|
|
SELECT
|
|
@@ -385,7 +389,9 @@
|
|
|
COUNT(DISTINCT CASE WHEN sensor_anomaly_wind_pwr = 1 THEN engine_id END) AS 'sensorAnomalyWindPwrCount',
|
|
COUNT(DISTINCT CASE WHEN sensor_anomaly_wind_pwr = 1 THEN engine_id END) AS 'sensorAnomalyWindPwrCount',
|
|
|
|
|
|
|
|
|
|
|
|
|
- COUNT(DISTINCT CASE WHEN sensor_anomaly_spd_trq = 1 THEN engine_id END) AS 'sensorAnomalySpdTrqCount'
|
|
|
|
|
|
|
+ COUNT(DISTINCT CASE WHEN sensor_anomaly_spd_trq = 1 THEN engine_id END) AS 'sensorAnomalySpdTrqCount',
|
|
|
|
|
+
|
|
|
|
|
+ COUNT(DISTINCT CASE WHEN sensor_anomaly_yaw = 1 THEN engine_id END) AS 'sensorAnomalyFreezeCount'
|
|
|
|
|
|
|
|
FROM anomaly_model_${year}
|
|
FROM anomaly_model_${year}
|
|
|
where 1=1
|
|
where 1=1
|
|
@@ -393,17 +399,17 @@
|
|
|
and field_id = #{fieldId}
|
|
and field_id = #{fieldId}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="beginTime != null and beginTime != ''">
|
|
<if test="beginTime != null and beginTime != ''">
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
</if>
|
|
</if>
|
|
|
<if test="endTime != null and endTime != ''">
|
|
<if test="endTime != null and endTime != ''">
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
</if>
|
|
</if>
|
|
|
GROUP BY field_id
|
|
GROUP BY field_id
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- <!-- yichangjianc异常检测统计 -->
|
|
|
|
|
- <select id="selectModeCount" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyCount">
|
|
|
|
|
|
|
+ </select>
|
|
|
|
|
+ <!-- yichangjianc异常检测统计 -->
|
|
|
|
|
+ <select id="selectModeCount" resultType="com.energy.manage.analyse.domain.vo.anomaly.AnomalyCount">
|
|
|
|
|
|
|
|
SELECT
|
|
SELECT
|
|
|
field_id,
|
|
field_id,
|
|
@@ -437,22 +443,20 @@ SELECT
|
|
|
|
|
|
|
|
FROM anomaly_model_${year}
|
|
FROM anomaly_model_${year}
|
|
|
WHERE field_id =#{fieldId}
|
|
WHERE field_id =#{fieldId}
|
|
|
- <if test="beginTime != null and beginTime != ''">
|
|
|
|
|
- and source_datetime <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
- </if>
|
|
|
|
|
- <if test="endTime != null and endTime != ''">
|
|
|
|
|
- and source_datetime <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
- </if>
|
|
|
|
|
|
|
+ <if test="beginTime != null and beginTime != ''">
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[>= ]]> #{beginTime}
|
|
|
|
|
+ </if>
|
|
|
|
|
+ <if test="endTime != null and endTime != ''">
|
|
|
|
|
+ and source_datetime
|
|
|
|
|
+ <![CDATA[<= ]]> #{endTime}
|
|
|
|
|
+ </if>
|
|
|
GROUP BY field_id;
|
|
GROUP BY field_id;
|
|
|
- </select>
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+ </select>
|
|
|
<select id="selectEngineCountByCode" resultType="Integer">
|
|
<select id="selectEngineCountByCode" resultType="Integer">
|
|
|
select count(1) as engineCount
|
|
select count(1) as engineCount
|
|
|
from wind_field wf
|
|
from wind_field wf
|
|
|
inner join wind_engine_group weg on wf.field_code = weg.field_code
|
|
inner join wind_engine_group weg on wf.field_code = weg.field_code
|
|
|
where wf.company_code = #{companyCode}
|
|
where wf.company_code = #{companyCode}
|
|
|
</select>
|
|
</select>
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
- </mapper>
|
|
|
|
|
|
|
+</mapper>
|