2025-06-17 19:18:39 +08:00
|
|
|
<?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">
|
|
|
|
|
<mapper namespace="com.xzzn.ems.mapper.EmsPcsDataMapper">
|
|
|
|
|
|
|
|
|
|
<resultMap type="EmsPcsData" id="EmsPcsDataResult">
|
|
|
|
|
<result property="id" column="id" />
|
|
|
|
|
<result property="dataUpdateTime" column="data_update_time" />
|
|
|
|
|
<result property="workStatus" column="work_status" />
|
|
|
|
|
<result property="gridStatus" column="grid_status" />
|
|
|
|
|
<result property="deviceStatus" column="device_status" />
|
|
|
|
|
<result property="controlMode" column="control_mode" />
|
|
|
|
|
<result property="totalActivePower" column="total_active_power" />
|
|
|
|
|
<result property="dailyAcChargeEnergy" column="daily_ac_charge_energy" />
|
|
|
|
|
<result property="aPhaseVoltage" column="a_phase_voltage" />
|
|
|
|
|
<result property="aPhaseCurrent" column="a_phase_current" />
|
|
|
|
|
<result property="totalReactivePower" column="total_reactive_power" />
|
|
|
|
|
<result property="dailyAcDischargeEnergy" column="daily_ac_discharge_energy" />
|
|
|
|
|
<result property="bPhaseVoltage" column="b_phase_voltage" />
|
|
|
|
|
<result property="bPhaseCurrent" column="b_phase_current" />
|
|
|
|
|
<result property="totalApparentPower" column="total_apparent_power" />
|
|
|
|
|
<result property="pcsModuleTemperature" column="pcs_module_temperature" />
|
|
|
|
|
<result property="cPhaseVoltage" column="c_phase_voltage" />
|
|
|
|
|
<result property="cPhaseCurrent" column="c_phase_current" />
|
|
|
|
|
<result property="totalPowerFactor" column="total_power_factor" />
|
|
|
|
|
<result property="pcsEnvironmentTemperature" column="pcs_environment_temperature" />
|
|
|
|
|
<result property="acFrequency" column="ac_frequency" />
|
|
|
|
|
<result property="branchStatus" column="branch_status" />
|
|
|
|
|
<result property="dischargeStatus" column="discharge_status" />
|
|
|
|
|
<result property="dcPower" column="dc_power" />
|
|
|
|
|
<result property="dcVoltage" column="dc_voltage" />
|
|
|
|
|
<result property="dcCurrent" column="dc_current" />
|
|
|
|
|
<result property="createBy" column="create_by" />
|
|
|
|
|
<result property="createTime" column="create_time" />
|
|
|
|
|
<result property="updateBy" column="update_by" />
|
|
|
|
|
<result property="updateTime" column="update_time" />
|
|
|
|
|
<result property="remark" column="remark" />
|
|
|
|
|
<result property="siteId" column="site_id" />
|
|
|
|
|
<result property="deviceId" column="device_id" />
|
|
|
|
|
<result property="dateMonth" column="date_month" />
|
|
|
|
|
<result property="dateDay" column="date_day" />
|
2025-06-28 23:07:49 +08:00
|
|
|
<result property="totalAcChargeEnergy" column="total_ac_charge_energy" />
|
|
|
|
|
<result property="totalAcDischargeEnergy" column="total_ac_discharge_energy" />
|
|
|
|
|
<result property="acChargeActivePower" column="ac_charge_active_power" />
|
|
|
|
|
<result property="acCapacitiveReactivePower" column="ac_capacitive_reactive_power" />
|
|
|
|
|
<result property="acDischargeActivePower" column="ac_discharge_active_power" />
|
|
|
|
|
<result property="acInductiveReactivePower" column="ac_inductive_reactive_power" />
|
|
|
|
|
<result property="maxCapacitivePowerCapacity" column="max_capacitive_power_capacity" />
|
|
|
|
|
<result property="maxInductivePowerCapacity" column="max_inductive_power_capacity" />
|
|
|
|
|
<result property="maxChargePowerCapacity" column="max_charge_power_capacity" />
|
|
|
|
|
<result property="maxDischargePowerCapacity" column="max_discharge_power_capacity" />
|
|
|
|
|
<result property="acSwitchStatus" column="ac_switch_status" />
|
|
|
|
|
<result property="dcSwitchStatus" column="dc_switch_status" />
|
|
|
|
|
<result property="remoteControlStatus" column="remote_control_status" />
|
2025-07-07 15:32:30 +08:00
|
|
|
<result property="sysUCurrent" column="sys_u_current" />
|
|
|
|
|
<result property="sysVCurrent" column="sys_v_current" />
|
|
|
|
|
<result property="sysWCurrent" column="sys_w_current" />
|
2025-07-27 17:34:38 +08:00
|
|
|
<result property="dwFrequency" column="dw_frequency" />
|
2025-06-17 19:18:39 +08:00
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectEmsPcsDataVo">
|
2025-07-27 17:34:38 +08:00
|
|
|
select id, data_update_time, work_status, grid_status, device_status, control_mode, total_active_power, daily_ac_charge_energy, a_phase_voltage, a_phase_current, total_reactive_power, daily_ac_discharge_energy, b_phase_voltage, b_phase_current, total_apparent_power, pcs_module_temperature, c_phase_voltage, c_phase_current, total_power_factor, pcs_environment_temperature, ac_frequency, branch_status, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, date_month, date_day, total_ac_charge_energy, total_ac_discharge_energy, ac_charge_active_power, ac_capacitive_reactive_power, ac_discharge_active_power, ac_inductive_reactive_power, max_capacitive_power_capacity, max_inductive_power_capacity, max_charge_power_capacity, max_discharge_power_capacity, ac_switch_status, dc_switch_status, remote_control_status, sys_u_current, sys_v_current, sys_w_current, dw_frequency from ems_pcs_data
|
2025-06-17 19:18:39 +08:00
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectEmsPcsDataList" parameterType="EmsPcsData" resultMap="EmsPcsDataResult">
|
|
|
|
|
<include refid="selectEmsPcsDataVo"/>
|
|
|
|
|
<where>
|
|
|
|
|
<if test="dataUpdateTime != null "> and data_update_time = #{dataUpdateTime}</if>
|
|
|
|
|
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
|
|
|
|
|
<if test="gridStatus != null and gridStatus != ''"> and grid_status = #{gridStatus}</if>
|
|
|
|
|
<if test="deviceStatus != null and deviceStatus != ''"> and device_status = #{deviceStatus}</if>
|
|
|
|
|
<if test="controlMode != null and controlMode != ''"> and control_mode = #{controlMode}</if>
|
|
|
|
|
<if test="totalActivePower != null "> and total_active_power = #{totalActivePower}</if>
|
|
|
|
|
<if test="dailyAcChargeEnergy != null "> and daily_ac_charge_energy = #{dailyAcChargeEnergy}</if>
|
|
|
|
|
<if test="aPhaseVoltage != null "> and a_phase_voltage = #{aPhaseVoltage}</if>
|
|
|
|
|
<if test="aPhaseCurrent != null "> and a_phase_current = #{aPhaseCurrent}</if>
|
|
|
|
|
<if test="totalReactivePower != null "> and total_reactive_power = #{totalReactivePower}</if>
|
|
|
|
|
<if test="dailyAcDischargeEnergy != null "> and daily_ac_discharge_energy = #{dailyAcDischargeEnergy}</if>
|
|
|
|
|
<if test="bPhaseVoltage != null "> and b_phase_voltage = #{bPhaseVoltage}</if>
|
|
|
|
|
<if test="bPhaseCurrent != null "> and b_phase_current = #{bPhaseCurrent}</if>
|
|
|
|
|
<if test="totalApparentPower != null "> and total_apparent_power = #{totalApparentPower}</if>
|
|
|
|
|
<if test="pcsModuleTemperature != null "> and pcs_module_temperature = #{pcsModuleTemperature}</if>
|
|
|
|
|
<if test="cPhaseVoltage != null "> and c_phase_voltage = #{cPhaseVoltage}</if>
|
|
|
|
|
<if test="cPhaseCurrent != null "> and c_phase_current = #{cPhaseCurrent}</if>
|
|
|
|
|
<if test="totalPowerFactor != null "> and total_power_factor = #{totalPowerFactor}</if>
|
|
|
|
|
<if test="pcsEnvironmentTemperature != null "> and pcs_environment_temperature = #{pcsEnvironmentTemperature}</if>
|
|
|
|
|
<if test="acFrequency != null "> and ac_frequency = #{acFrequency}</if>
|
|
|
|
|
<if test="branchStatus != null and branchStatus != ''"> and branch_status = #{branchStatus}</if>
|
|
|
|
|
<if test="dischargeStatus != null and dischargeStatus != ''"> and discharge_status = #{dischargeStatus}</if>
|
|
|
|
|
<if test="dcPower != null "> and dc_power = #{dcPower}</if>
|
|
|
|
|
<if test="dcVoltage != null "> and dc_voltage = #{dcVoltage}</if>
|
|
|
|
|
<if test="dcCurrent != null "> and dc_current = #{dcCurrent}</if>
|
2025-06-29 10:55:05 +08:00
|
|
|
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
2025-06-24 17:04:59 +08:00
|
|
|
<if test="dateMonth != null "> and date_month = #{dateMonth}</if>
|
|
|
|
|
<if test="dateDay != null "> and date_day = #{dateDay}</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="totalAcChargeEnergy != null "> and total_ac_charge_energy = #{totalAcChargeEnergy}</if>
|
|
|
|
|
<if test="totalAcDischargeEnergy != null "> and total_ac_discharge_energy = #{totalAcDischargeEnergy}</if>
|
|
|
|
|
<if test="acChargeActivePower != null "> and ac_charge_active_power = #{acChargeActivePower}</if>
|
|
|
|
|
<if test="acCapacitiveReactivePower != null "> and ac_capacitive_reactive_power = #{acCapacitiveReactivePower}</if>
|
|
|
|
|
<if test="acDischargeActivePower != null "> and ac_discharge_active_power = #{acDischargeActivePower}</if>
|
|
|
|
|
<if test="acInductiveReactivePower != null "> and ac_inductive_reactive_power = #{acInductiveReactivePower}</if>
|
|
|
|
|
<if test="maxCapacitivePowerCapacity != null "> and max_capacitive_power_capacity = #{maxCapacitivePowerCapacity}</if>
|
|
|
|
|
<if test="maxInductivePowerCapacity != null "> and max_inductive_power_capacity = #{maxInductivePowerCapacity}</if>
|
|
|
|
|
<if test="maxChargePowerCapacity != null "> and max_charge_power_capacity = #{maxChargePowerCapacity}</if>
|
|
|
|
|
<if test="maxDischargePowerCapacity != null "> and max_discharge_power_capacity = #{maxDischargePowerCapacity}</if>
|
|
|
|
|
<if test="acSwitchStatus != null and acSwitchStatus != ''"> and ac_switch_status = #{acSwitchStatus}</if>
|
|
|
|
|
<if test="dcSwitchStatus != null and dcSwitchStatus != ''"> and dc_switch_status = #{dcSwitchStatus}</if>
|
|
|
|
|
<if test="remoteControlStatus != null and remoteControlStatus != ''"> and remote_control_status = #{remoteControlStatus}</if>
|
2025-07-07 15:32:30 +08:00
|
|
|
<if test="sysUCurrent != null "> and sys_u_current = #{sysUCurrent}</if>
|
|
|
|
|
<if test="sysVCurrent != null "> and sys_v_current = #{sysVCurrent}</if>
|
|
|
|
|
<if test="sysWCurrent != null "> and sys_w_current = #{sysWCurrent}</if>
|
2025-07-27 17:34:38 +08:00
|
|
|
<if test="dwFrequency != null "> and dw_frequency = #{dwFrequency}</if>
|
2025-06-17 19:18:39 +08:00
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectEmsPcsDataById" parameterType="Long" resultMap="EmsPcsDataResult">
|
|
|
|
|
<include refid="selectEmsPcsDataVo"/>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertEmsPcsData" parameterType="EmsPcsData" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
|
insert into ems_pcs_data
|
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="dataUpdateTime != null">data_update_time,</if>
|
|
|
|
|
<if test="workStatus != null">work_status,</if>
|
|
|
|
|
<if test="gridStatus != null">grid_status,</if>
|
|
|
|
|
<if test="deviceStatus != null">device_status,</if>
|
|
|
|
|
<if test="controlMode != null">control_mode,</if>
|
|
|
|
|
<if test="totalActivePower != null">total_active_power,</if>
|
|
|
|
|
<if test="dailyAcChargeEnergy != null">daily_ac_charge_energy,</if>
|
|
|
|
|
<if test="aPhaseVoltage != null">a_phase_voltage,</if>
|
|
|
|
|
<if test="aPhaseCurrent != null">a_phase_current,</if>
|
|
|
|
|
<if test="totalReactivePower != null">total_reactive_power,</if>
|
|
|
|
|
<if test="dailyAcDischargeEnergy != null">daily_ac_discharge_energy,</if>
|
|
|
|
|
<if test="bPhaseVoltage != null">b_phase_voltage,</if>
|
|
|
|
|
<if test="bPhaseCurrent != null">b_phase_current,</if>
|
|
|
|
|
<if test="totalApparentPower != null">total_apparent_power,</if>
|
|
|
|
|
<if test="pcsModuleTemperature != null">pcs_module_temperature,</if>
|
|
|
|
|
<if test="cPhaseVoltage != null">c_phase_voltage,</if>
|
|
|
|
|
<if test="cPhaseCurrent != null">c_phase_current,</if>
|
|
|
|
|
<if test="totalPowerFactor != null">total_power_factor,</if>
|
|
|
|
|
<if test="pcsEnvironmentTemperature != null">pcs_environment_temperature,</if>
|
|
|
|
|
<if test="acFrequency != null">ac_frequency,</if>
|
|
|
|
|
<if test="branchStatus != null">branch_status,</if>
|
|
|
|
|
<if test="dischargeStatus != null">discharge_status,</if>
|
|
|
|
|
<if test="dcPower != null">dc_power,</if>
|
|
|
|
|
<if test="dcVoltage != null">dc_voltage,</if>
|
|
|
|
|
<if test="dcCurrent != null">dc_current,</if>
|
|
|
|
|
<if test="createBy != null">create_by,</if>
|
|
|
|
|
<if test="createTime != null">create_time,</if>
|
|
|
|
|
<if test="updateBy != null">update_by,</if>
|
|
|
|
|
<if test="updateTime != null">update_time,</if>
|
|
|
|
|
<if test="remark != null">remark,</if>
|
|
|
|
|
<if test="siteId != null">site_id,</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
2025-06-24 17:04:59 +08:00
|
|
|
<if test="dateMonth != null">date_month,</if>
|
|
|
|
|
<if test="dateDay != null">date_day,</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="totalAcChargeEnergy != null">total_ac_charge_energy,</if>
|
|
|
|
|
<if test="totalAcDischargeEnergy != null">total_ac_discharge_energy,</if>
|
|
|
|
|
<if test="acChargeActivePower != null">ac_charge_active_power,</if>
|
|
|
|
|
<if test="acCapacitiveReactivePower != null">ac_capacitive_reactive_power,</if>
|
|
|
|
|
<if test="acDischargeActivePower != null">ac_discharge_active_power,</if>
|
|
|
|
|
<if test="acInductiveReactivePower != null">ac_inductive_reactive_power,</if>
|
|
|
|
|
<if test="maxCapacitivePowerCapacity != null">max_capacitive_power_capacity,</if>
|
|
|
|
|
<if test="maxInductivePowerCapacity != null">max_inductive_power_capacity,</if>
|
|
|
|
|
<if test="maxChargePowerCapacity != null">max_charge_power_capacity,</if>
|
|
|
|
|
<if test="maxDischargePowerCapacity != null">max_discharge_power_capacity,</if>
|
|
|
|
|
<if test="acSwitchStatus != null">ac_switch_status,</if>
|
|
|
|
|
<if test="dcSwitchStatus != null">dc_switch_status,</if>
|
|
|
|
|
<if test="remoteControlStatus != null">remote_control_status,</if>
|
2025-07-07 15:32:30 +08:00
|
|
|
<if test="sysUCurrent != null">sys_u_current,</if>
|
|
|
|
|
<if test="sysVCurrent != null">sys_v_current,</if>
|
|
|
|
|
<if test="sysWCurrent != null">sys_w_current,</if>
|
2025-07-27 17:34:38 +08:00
|
|
|
<if test="dwFrequency != null">dw_frequency,</if>
|
2025-06-17 19:18:39 +08:00
|
|
|
</trim>
|
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
|
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
|
|
|
|
<if test="workStatus != null">#{workStatus},</if>
|
|
|
|
|
<if test="gridStatus != null">#{gridStatus},</if>
|
|
|
|
|
<if test="deviceStatus != null">#{deviceStatus},</if>
|
|
|
|
|
<if test="controlMode != null">#{controlMode},</if>
|
|
|
|
|
<if test="totalActivePower != null">#{totalActivePower},</if>
|
|
|
|
|
<if test="dailyAcChargeEnergy != null">#{dailyAcChargeEnergy},</if>
|
|
|
|
|
<if test="aPhaseVoltage != null">#{aPhaseVoltage},</if>
|
|
|
|
|
<if test="aPhaseCurrent != null">#{aPhaseCurrent},</if>
|
|
|
|
|
<if test="totalReactivePower != null">#{totalReactivePower},</if>
|
|
|
|
|
<if test="dailyAcDischargeEnergy != null">#{dailyAcDischargeEnergy},</if>
|
|
|
|
|
<if test="bPhaseVoltage != null">#{bPhaseVoltage},</if>
|
|
|
|
|
<if test="bPhaseCurrent != null">#{bPhaseCurrent},</if>
|
|
|
|
|
<if test="totalApparentPower != null">#{totalApparentPower},</if>
|
|
|
|
|
<if test="pcsModuleTemperature != null">#{pcsModuleTemperature},</if>
|
|
|
|
|
<if test="cPhaseVoltage != null">#{cPhaseVoltage},</if>
|
|
|
|
|
<if test="cPhaseCurrent != null">#{cPhaseCurrent},</if>
|
|
|
|
|
<if test="totalPowerFactor != null">#{totalPowerFactor},</if>
|
|
|
|
|
<if test="pcsEnvironmentTemperature != null">#{pcsEnvironmentTemperature},</if>
|
|
|
|
|
<if test="acFrequency != null">#{acFrequency},</if>
|
|
|
|
|
<if test="branchStatus != null">#{branchStatus},</if>
|
|
|
|
|
<if test="dischargeStatus != null">#{dischargeStatus},</if>
|
|
|
|
|
<if test="dcPower != null">#{dcPower},</if>
|
|
|
|
|
<if test="dcVoltage != null">#{dcVoltage},</if>
|
|
|
|
|
<if test="dcCurrent != null">#{dcCurrent},</if>
|
|
|
|
|
<if test="createBy != null">#{createBy},</if>
|
|
|
|
|
<if test="createTime != null">#{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
|
|
|
<if test="remark != null">#{remark},</if>
|
|
|
|
|
<if test="siteId != null">#{siteId},</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
2025-06-24 17:04:59 +08:00
|
|
|
<if test="dateMonth != null">#{dateMonth},</if>
|
|
|
|
|
<if test="dateDay != null">#{dateDay},</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="totalAcChargeEnergy != null">#{totalAcChargeEnergy},</if>
|
|
|
|
|
<if test="totalAcDischargeEnergy != null">#{totalAcDischargeEnergy},</if>
|
|
|
|
|
<if test="acChargeActivePower != null">#{acChargeActivePower},</if>
|
|
|
|
|
<if test="acCapacitiveReactivePower != null">#{acCapacitiveReactivePower},</if>
|
|
|
|
|
<if test="acDischargeActivePower != null">#{acDischargeActivePower},</if>
|
|
|
|
|
<if test="acInductiveReactivePower != null">#{acInductiveReactivePower},</if>
|
|
|
|
|
<if test="maxCapacitivePowerCapacity != null">#{maxCapacitivePowerCapacity},</if>
|
|
|
|
|
<if test="maxInductivePowerCapacity != null">#{maxInductivePowerCapacity},</if>
|
|
|
|
|
<if test="maxChargePowerCapacity != null">#{maxChargePowerCapacity},</if>
|
|
|
|
|
<if test="maxDischargePowerCapacity != null">#{maxDischargePowerCapacity},</if>
|
|
|
|
|
<if test="acSwitchStatus != null">#{acSwitchStatus},</if>
|
|
|
|
|
<if test="dcSwitchStatus != null">#{dcSwitchStatus},</if>
|
|
|
|
|
<if test="remoteControlStatus != null">#{remoteControlStatus},</if>
|
2025-07-07 15:32:30 +08:00
|
|
|
<if test="sysUCurrent != null">#{sysUCurrent},</if>
|
|
|
|
|
<if test="sysVCurrent != null">#{sysVCurrent},</if>
|
|
|
|
|
<if test="sysWCurrent != null">#{sysWCurrent},</if>
|
2025-07-27 17:34:38 +08:00
|
|
|
<if test="dwFrequency != null">#{dwFrequency},</if>
|
2025-06-17 19:18:39 +08:00
|
|
|
</trim>
|
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
|
|
<update id="updateEmsPcsData" parameterType="EmsPcsData">
|
|
|
|
|
update ems_pcs_data
|
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
|
<if test="dataUpdateTime != null">data_update_time = #{dataUpdateTime},</if>
|
|
|
|
|
<if test="workStatus != null">work_status = #{workStatus},</if>
|
|
|
|
|
<if test="gridStatus != null">grid_status = #{gridStatus},</if>
|
|
|
|
|
<if test="deviceStatus != null">device_status = #{deviceStatus},</if>
|
|
|
|
|
<if test="controlMode != null">control_mode = #{controlMode},</if>
|
|
|
|
|
<if test="totalActivePower != null">total_active_power = #{totalActivePower},</if>
|
|
|
|
|
<if test="dailyAcChargeEnergy != null">daily_ac_charge_energy = #{dailyAcChargeEnergy},</if>
|
|
|
|
|
<if test="aPhaseVoltage != null">a_phase_voltage = #{aPhaseVoltage},</if>
|
|
|
|
|
<if test="aPhaseCurrent != null">a_phase_current = #{aPhaseCurrent},</if>
|
|
|
|
|
<if test="totalReactivePower != null">total_reactive_power = #{totalReactivePower},</if>
|
|
|
|
|
<if test="dailyAcDischargeEnergy != null">daily_ac_discharge_energy = #{dailyAcDischargeEnergy},</if>
|
|
|
|
|
<if test="bPhaseVoltage != null">b_phase_voltage = #{bPhaseVoltage},</if>
|
|
|
|
|
<if test="bPhaseCurrent != null">b_phase_current = #{bPhaseCurrent},</if>
|
|
|
|
|
<if test="totalApparentPower != null">total_apparent_power = #{totalApparentPower},</if>
|
|
|
|
|
<if test="pcsModuleTemperature != null">pcs_module_temperature = #{pcsModuleTemperature},</if>
|
|
|
|
|
<if test="cPhaseVoltage != null">c_phase_voltage = #{cPhaseVoltage},</if>
|
|
|
|
|
<if test="cPhaseCurrent != null">c_phase_current = #{cPhaseCurrent},</if>
|
|
|
|
|
<if test="totalPowerFactor != null">total_power_factor = #{totalPowerFactor},</if>
|
|
|
|
|
<if test="pcsEnvironmentTemperature != null">pcs_environment_temperature = #{pcsEnvironmentTemperature},</if>
|
|
|
|
|
<if test="acFrequency != null">ac_frequency = #{acFrequency},</if>
|
|
|
|
|
<if test="branchStatus != null">branch_status = #{branchStatus},</if>
|
|
|
|
|
<if test="dischargeStatus != null">discharge_status = #{dischargeStatus},</if>
|
|
|
|
|
<if test="dcPower != null">dc_power = #{dcPower},</if>
|
|
|
|
|
<if test="dcVoltage != null">dc_voltage = #{dcVoltage},</if>
|
|
|
|
|
<if test="dcCurrent != null">dc_current = #{dcCurrent},</if>
|
|
|
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
|
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
|
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
|
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
|
|
|
<if test="remark != null">remark = #{remark},</if>
|
|
|
|
|
<if test="siteId != null">site_id = #{siteId},</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
2025-06-24 17:04:59 +08:00
|
|
|
<if test="dateMonth != null">date_month = #{dateMonth},</if>
|
|
|
|
|
<if test="dateDay != null">date_day = #{dateDay},</if>
|
2025-06-28 23:07:49 +08:00
|
|
|
<if test="totalAcChargeEnergy != null">total_ac_charge_energy = #{totalAcChargeEnergy},</if>
|
|
|
|
|
<if test="totalAcDischargeEnergy != null">total_ac_discharge_energy = #{totalAcDischargeEnergy},</if>
|
|
|
|
|
<if test="acChargeActivePower != null">ac_charge_active_power = #{acChargeActivePower},</if>
|
|
|
|
|
<if test="acCapacitiveReactivePower != null">ac_capacitive_reactive_power = #{acCapacitiveReactivePower},</if>
|
|
|
|
|
<if test="acDischargeActivePower != null">ac_discharge_active_power = #{acDischargeActivePower},</if>
|
|
|
|
|
<if test="acInductiveReactivePower != null">ac_inductive_reactive_power = #{acInductiveReactivePower},</if>
|
|
|
|
|
<if test="maxCapacitivePowerCapacity != null">max_capacitive_power_capacity = #{maxCapacitivePowerCapacity},</if>
|
|
|
|
|
<if test="maxInductivePowerCapacity != null">max_inductive_power_capacity = #{maxInductivePowerCapacity},</if>
|
|
|
|
|
<if test="maxChargePowerCapacity != null">max_charge_power_capacity = #{maxChargePowerCapacity},</if>
|
|
|
|
|
<if test="maxDischargePowerCapacity != null">max_discharge_power_capacity = #{maxDischargePowerCapacity},</if>
|
|
|
|
|
<if test="acSwitchStatus != null">ac_switch_status = #{acSwitchStatus},</if>
|
|
|
|
|
<if test="dcSwitchStatus != null">dc_switch_status = #{dcSwitchStatus},</if>
|
|
|
|
|
<if test="remoteControlStatus != null">remote_control_status = #{remoteControlStatus},</if>
|
2025-07-07 15:32:30 +08:00
|
|
|
<if test="sysUCurrent != null">sys_u_current = #{sysUCurrent},</if>
|
|
|
|
|
<if test="sysVCurrent != null">sys_v_current = #{sysVCurrent},</if>
|
|
|
|
|
<if test="sysWCurrent != null">sys_w_current = #{sysWCurrent},</if>
|
2025-07-27 17:34:38 +08:00
|
|
|
<if test="dwFrequency != null">dw_frequency = #{dwFrequency},</if>
|
2025-06-17 19:18:39 +08:00
|
|
|
</trim>
|
|
|
|
|
where id = #{id}
|
|
|
|
|
</update>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmsPcsDataById" parameterType="Long">
|
|
|
|
|
delete from ems_pcs_data where id = #{id}
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<delete id="deleteEmsPcsDataByIds" parameterType="String">
|
|
|
|
|
delete from ems_pcs_data where id in
|
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
|
#{id}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
2025-06-29 10:55:05 +08:00
|
|
|
|
2025-06-30 13:11:05 +08:00
|
|
|
<select id="getPcsDataBySiteId" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
2025-07-18 20:14:38 +08:00
|
|
|
select CONCAT(t.date_month,'-',t.date_day) as ammeterDate,
|
|
|
|
|
sum(t.daily_ac_charge_energy) as chargedCap,
|
|
|
|
|
sum(t.daily_ac_discharge_energy) as disChargedCap
|
|
|
|
|
from ems_pcs_data t
|
|
|
|
|
inner join( SELECT p.site_id, p.device_id, p.date_month,p.date_day, MAX(p.data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data p
|
2025-08-11 14:49:18 +08:00
|
|
|
<include refid="commonFilter"/>
|
2025-07-18 20:14:38 +08:00
|
|
|
GROUP BY p.site_id,p.device_id,p.date_month,p.date_day
|
|
|
|
|
) latest ON t.site_id = latest.site_id
|
|
|
|
|
AND t.device_id = latest.device_id
|
|
|
|
|
AND t.date_month = latest.date_month
|
|
|
|
|
AND t.date_day = latest.date_day
|
|
|
|
|
AND t.data_update_time = latest.max_update_time
|
2025-08-11 19:56:51 +08:00
|
|
|
group by ammeterDate,t.date_month,t.date_day
|
|
|
|
|
order by t.date_month desc, t.date_day desc
|
2025-06-29 10:55:05 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsTotalChargeData" resultType="map">
|
2025-06-30 13:11:05 +08:00
|
|
|
SELECT
|
2025-07-18 20:14:38 +08:00
|
|
|
SUM(p.total_ac_charge_energy) AS totalChargedCap,
|
|
|
|
|
SUM(p.total_ac_discharge_energy) AS totalDischargedCap,
|
|
|
|
|
SUM(p.total_active_power) AS gridNrtPower
|
|
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
INNER JOIN ems_site_setting s ON p.site_id = s.site_id
|
|
|
|
|
INNER JOIN ( SELECT site_id, device_id, MAX(data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data
|
|
|
|
|
<if test="siteId !=null and siteId !=''">
|
|
|
|
|
where site_id = #{siteId}
|
|
|
|
|
</if>
|
|
|
|
|
GROUP BY site_id, device_id
|
|
|
|
|
) latest ON p.site_id = latest.site_id
|
|
|
|
|
AND p.device_id = latest.device_id
|
|
|
|
|
AND p.data_update_time = latest.max_update_time
|
|
|
|
|
<if test="siteId !=null and siteId !=''">
|
|
|
|
|
where p.site_id = #{siteId}
|
|
|
|
|
</if>
|
2025-06-29 10:55:05 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getSiteRunningHeadInfo" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteMonitorRunningHeadInfoVo">
|
2025-06-30 13:11:05 +08:00
|
|
|
SELECT
|
|
|
|
|
SUM(t.total_active_power) as totalActivePower,
|
|
|
|
|
SUM(t.total_reactive_power) as totalReactivePower,
|
|
|
|
|
sum(t.daily_ac_charge_energy) as dayChargedCap,
|
2025-07-22 13:54:07 +08:00
|
|
|
sum(t.daily_ac_discharge_energy) as dayDisChargedCap
|
2025-06-30 13:11:05 +08:00
|
|
|
FROM (
|
|
|
|
|
SELECT p.device_id, MAX(p.data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
where p.site_id = #{siteId}
|
2025-09-13 21:49:33 +08:00
|
|
|
and p.data_update_time <= CURDATE()
|
2025-06-30 13:11:05 +08:00
|
|
|
GROUP BY p.device_id
|
|
|
|
|
) latest inner join ems_pcs_data t ON latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
AND t.site_id = #{siteId}
|
2025-06-29 10:55:05 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getElectDataList" resultType="com.xzzn.ems.domain.vo.ElectricIndexList">
|
2025-07-09 16:57:41 +08:00
|
|
|
SELECT DATE_FORMAT(t.data_update_time, '%Y-%m') AS dateMonth,
|
|
|
|
|
SUM(t.daily_ac_charge_energy) AS chargeEnergy,
|
|
|
|
|
SUM(t.daily_ac_discharge_energy) AS disChargeEnergy
|
|
|
|
|
FROM ems_pcs_data t
|
2025-07-18 20:14:38 +08:00
|
|
|
INNER JOIN ( SELECT site_id, device_id, date_month, date_day, MAX(data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data
|
|
|
|
|
GROUP BY site_id, device_id, date_month, date_day
|
2025-07-09 16:57:41 +08:00
|
|
|
) max_dates ON t.site_id = max_dates.site_id
|
|
|
|
|
AND t.device_id = max_dates.device_id
|
|
|
|
|
AND t.date_month = max_dates.date_month
|
|
|
|
|
AND t.date_day = max_dates.date_day
|
|
|
|
|
AND t.data_update_time = max_dates.max_update_time
|
|
|
|
|
GROUP BY dateMonth
|
2025-07-18 01:38:30 +08:00
|
|
|
ORDER BY dateMonth
|
2025-06-29 10:55:05 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsDetailInfoBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.PcsDetailInfoVo">
|
2025-06-30 13:11:05 +08:00
|
|
|
SELECT td.device_name as deviceName,
|
2025-06-29 10:55:05 +08:00
|
|
|
td.communication_status as communicationStatus,
|
|
|
|
|
tmp.site_id as siteId,
|
|
|
|
|
tmp.device_id as deviceId,
|
|
|
|
|
tmp.data_update_time as dataUpdateTime,tmp.work_status as workStatus,
|
|
|
|
|
tmp.grid_status as gridStatus,tmp.device_status as deviceStatus,tmp.control_mode as controlMode,
|
|
|
|
|
tmp.total_active_power as totalActivePower,tmp.daily_ac_charge_energy as dailyAcChargeEnergy,
|
|
|
|
|
tmp.a_phase_voltage as aPhaseVoltage,tmp.a_phase_current as aPhaseCurrent,
|
|
|
|
|
tmp.total_reactive_power as totalReactivePower,tmp.daily_ac_discharge_energy as dailyAcDischargeEnergy,
|
|
|
|
|
tmp.b_phase_voltage as bPhaseVoltage,tmp.b_phase_current as bPhaseCurrent,
|
|
|
|
|
tmp.total_apparent_power as totalApparentPower,tmp.pcs_module_temperature as pcsModuleTemperature,
|
|
|
|
|
tmp.c_phase_current as cPhaseVoltage,tmp.c_phase_current as cPhaseCurrent,
|
|
|
|
|
tmp.total_power_factor as totalPowerFactor,
|
|
|
|
|
tmp.pcs_environment_temperature as pcsEnvironmentTemperature,tmp.ac_frequency as acFrequency
|
2025-06-30 13:11:05 +08:00
|
|
|
FROM ems_pcs_data tmp
|
|
|
|
|
LEFT JOIN ems_devices_setting td on tmp.device_id = td.device_id and tmp.site_id = td.site_id
|
|
|
|
|
INNER JOIN ( SELECT p.site_id, p.device_id, MAX(p.data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
WHERE p.site_id = #{siteId}
|
|
|
|
|
GROUP BY p.site_id,p.device_id
|
|
|
|
|
) latest on tmp.device_id = latest.device_id and tmp.data_update_time = latest.max_update_time
|
|
|
|
|
WHERE tmp.site_id = #{siteId}
|
2025-06-29 10:55:05 +08:00
|
|
|
order by tmp.device_id
|
|
|
|
|
</select>
|
2025-06-30 22:22:47 +08:00
|
|
|
|
2025-07-07 22:15:01 +08:00
|
|
|
<sql id="commonFilter">
|
|
|
|
|
WHERE p.site_id = #{siteId}
|
|
|
|
|
<if test="startDate != null">
|
|
|
|
|
AND p.data_update_time >= #{startDate}
|
|
|
|
|
</if>
|
|
|
|
|
<if test="endDate != null">
|
|
|
|
|
AND p.data_update_time < #{endDate}
|
|
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
2025-07-05 23:24:13 +08:00
|
|
|
<select id="getPcsDataByDay" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
2025-07-10 12:42:04 +08:00
|
|
|
select latest.dateDay as ammeterDate,
|
2025-07-05 23:24:13 +08:00
|
|
|
sum(t.total_ac_charge_energy) as chargedCap,
|
|
|
|
|
sum(t.total_ac_discharge_energy) as disChargedCap
|
2025-07-10 12:42:04 +08:00
|
|
|
from ( SELECT p.site_id, p.device_id,DATE(p.data_update_time) as dateDay, MAX(p.data_update_time) AS max_update_time
|
2025-06-30 22:22:47 +08:00
|
|
|
FROM ems_pcs_data p
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="commonFilter"/>
|
2025-07-10 12:42:04 +08:00
|
|
|
GROUP BY p.site_id,p.device_id,dateDay
|
2025-06-30 22:22:47 +08:00
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
group by ammeterDate
|
2025-07-05 23:24:13 +08:00
|
|
|
order by ammeterDate desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getStoragePowerList" resultType="com.xzzn.ems.domain.vo.EnergyStoragePowVo">
|
2025-07-18 20:14:38 +08:00
|
|
|
SELECT t.site_id,
|
|
|
|
|
SUM(t.total_active_power) AS pcsTotalActPower,
|
|
|
|
|
SUM(t.total_reactive_power) AS pcsTotalReactivePower,
|
|
|
|
|
DATE_FORMAT(t.data_update_time, '%Y-%m-%d %H:%i:00') AS createDate
|
|
|
|
|
FROM ems_pcs_data t
|
|
|
|
|
WHERE t.site_id = #{siteId}
|
|
|
|
|
AND t.data_update_time >= Date(#{startDate})
|
|
|
|
|
AND t.data_update_time <= #{endDate}
|
|
|
|
|
GROUP BY t.site_id, DATE_FORMAT(t.data_update_time, '%Y-%m-%d %H:%i:00')
|
|
|
|
|
ORDER BY createDate
|
2025-07-05 23:24:13 +08:00
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsDataByMonth" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
2025-07-07 15:00:59 +08:00
|
|
|
select DATE_FORMAT(latest.max_update_time, '%Y-%m') as ammeterDate,
|
2025-07-05 23:24:13 +08:00
|
|
|
sum(t.total_ac_charge_energy) as chargedCap,
|
|
|
|
|
sum(t.total_ac_discharge_energy) as disChargedCap
|
|
|
|
|
from ( SELECT p.site_id, p.device_id,p.date_month,MAX(p.data_update_time) AS max_update_time
|
|
|
|
|
FROM ems_pcs_data p
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="commonFilter"/>
|
2025-07-05 23:24:13 +08:00
|
|
|
GROUP BY p.site_id,p.device_id,p.date_month
|
|
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
and latest.date_month = t.date_month
|
|
|
|
|
group by ammeterDate
|
|
|
|
|
order by ammeterDate desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsDataByHour" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
|
|
|
|
select latest.dateHour as ammeterDate,
|
2025-09-12 04:40:47 +08:00
|
|
|
sum(t.daily_ac_charge_energy) as chargedCap,
|
|
|
|
|
sum(t.daily_ac_discharge_energy) as disChargedCap
|
2025-09-16 00:31:58 +08:00
|
|
|
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%H:00') AS dateHour,MAX(p.data_update_time) as max_update_time
|
2025-07-05 23:24:13 +08:00
|
|
|
FROM ems_pcs_data p
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="commonFilter"/>
|
2025-07-05 23:24:13 +08:00
|
|
|
GROUP BY p.site_id,p.device_id,dateHour
|
|
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
group by ammeterDate
|
|
|
|
|
order by ammeterDate desc
|
2025-06-30 22:22:47 +08:00
|
|
|
</select>
|
2025-07-07 22:15:01 +08:00
|
|
|
|
|
|
|
|
<sql id="statisCommonFilter">
|
|
|
|
|
WHERE p.site_id = #{siteId}
|
|
|
|
|
<if test="startDate != null">
|
2025-07-09 14:36:11 +08:00
|
|
|
AND p.data_update_time >= #{startDate}
|
2025-07-07 22:15:01 +08:00
|
|
|
</if>
|
|
|
|
|
<if test="endDate != null">
|
2025-07-09 14:36:11 +08:00
|
|
|
AND p.data_update_time < #{endDate}
|
2025-07-07 22:15:01 +08:00
|
|
|
</if>
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<sql id="dataTypeChooseFilter">
|
|
|
|
|
<choose>
|
2025-07-09 22:41:14 +08:00
|
|
|
<when test='dataType == "1"'>
|
2025-07-07 22:15:01 +08:00
|
|
|
t.total_active_power as activePower
|
|
|
|
|
</when>
|
2025-07-09 22:41:14 +08:00
|
|
|
<when test='dataType == "2"'>
|
2025-07-07 22:15:01 +08:00
|
|
|
t.total_reactive_power as reactivePower
|
|
|
|
|
</when>
|
2025-07-09 22:41:14 +08:00
|
|
|
<when test='dataType == "3"'>
|
2025-07-07 22:15:01 +08:00
|
|
|
t.sys_u_current as uCurrent,
|
|
|
|
|
t.sys_v_current as vCurrent,
|
|
|
|
|
t.sys_w_current as wCurrent
|
|
|
|
|
</when>
|
2025-07-09 22:41:14 +08:00
|
|
|
<otherwise>
|
|
|
|
|
0 as activePower
|
|
|
|
|
</otherwise>
|
2025-07-07 22:15:01 +08:00
|
|
|
</choose>
|
|
|
|
|
</sql>
|
|
|
|
|
|
2025-07-09 16:57:41 +08:00
|
|
|
|
2025-07-07 22:15:01 +08:00
|
|
|
<select id="getPcsActivePowerByDay" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsStatisListVo">
|
2025-07-10 12:42:04 +08:00
|
|
|
select latest.dateDay as statisDate,
|
2025-09-14 22:44:10 +08:00
|
|
|
t.device_id as deviceId,
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="dataTypeChooseFilter"/>
|
2025-07-10 12:42:04 +08:00
|
|
|
from ( SELECT p.site_id, p.device_id,DATE(p.data_update_time ) AS dateDay,MAX(p.data_update_time) as max_update_time
|
2025-07-07 22:15:01 +08:00
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
<include refid="statisCommonFilter"/>
|
2025-07-10 12:42:04 +08:00
|
|
|
GROUP BY p.site_id,p.device_id,dateDay
|
2025-07-07 22:15:01 +08:00
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
order by statisDate desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsActivePowerByMonth" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsStatisListVo">
|
|
|
|
|
select DATE_FORMAT(latest.max_update_time, '%Y-%m') as statisDate,
|
2025-09-14 22:44:10 +08:00
|
|
|
t.device_id as deviceId,
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="dataTypeChooseFilter"/>
|
|
|
|
|
from ( SELECT p.site_id, p.device_id,p.date_month,MAX(p.data_update_time) as max_update_time
|
|
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
<include refid="statisCommonFilter"/>
|
|
|
|
|
GROUP BY p.site_id,p.device_id,p.date_month
|
|
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
and latest.date_month = t.date_month
|
|
|
|
|
order by statisDate desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="getPcsActivePowerByHour" parameterType="com.xzzn.ems.domain.vo.DateSearchRequest" resultType="com.xzzn.ems.domain.vo.PcsStatisListVo">
|
|
|
|
|
select latest.dateHour as statisDate,
|
2025-09-14 22:44:10 +08:00
|
|
|
t.device_id as deviceId,
|
2025-07-07 22:15:01 +08:00
|
|
|
<include refid="dataTypeChooseFilter"/>
|
2025-09-16 00:31:58 +08:00
|
|
|
from ( SELECT p.site_id, p.device_id,DATE_FORMAT(p.data_update_time, '%H:00') AS dateHour,MAX(p.data_update_time) as max_update_time
|
2025-07-07 22:15:01 +08:00
|
|
|
FROM ems_pcs_data p
|
|
|
|
|
<include refid="statisCommonFilter"/>
|
|
|
|
|
GROUP BY p.site_id,p.device_id,dateHour
|
|
|
|
|
) latest inner join ems_pcs_data t ON latest.site_id = t.site_id
|
|
|
|
|
AND latest.device_id = t.device_id
|
|
|
|
|
AND latest.max_update_time = t.data_update_time
|
|
|
|
|
order by statisDate desc
|
|
|
|
|
</select>
|
2025-06-17 19:18:39 +08:00
|
|
|
</mapper>
|