修改 device id
This commit is contained in:
@ -40,11 +40,23 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="dateMonth" column="date_month" />
|
||||
<result property="dateDay" column="date_day" />
|
||||
<result property="communicationStatus" column="communication_status" />
|
||||
<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" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsPcsDataVo">
|
||||
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, communication_status from ems_pcs_data
|
||||
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 from ems_pcs_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPcsDataList" parameterType="EmsPcsData" resultMap="EmsPcsDataResult">
|
||||
@ -76,10 +88,22 @@
|
||||
<if test="dcVoltage != null "> and dc_voltage = #{dcVoltage}</if>
|
||||
<if test="dcCurrent != null "> and dc_current = #{dcCurrent}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="dateMonth != null "> and date_month = #{dateMonth}</if>
|
||||
<if test="dateDay != null "> and date_day = #{dateDay}</if>
|
||||
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
|
||||
<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>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -122,10 +146,22 @@
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="dateMonth != null">date_month,</if>
|
||||
<if test="dateDay != null">date_day,</if>
|
||||
<if test="communicationStatus != null">communication_status,</if>
|
||||
<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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
||||
@ -159,10 +195,22 @@
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="deviceId != null">#{deviceId},</if>
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="dateMonth != null">#{dateMonth},</if>
|
||||
<if test="dateDay != null">#{dateDay},</if>
|
||||
<if test="communicationStatus != null">#{communicationStatus},</if>
|
||||
<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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -200,10 +248,22 @@
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="dateMonth != null">date_month = #{dateMonth},</if>
|
||||
<if test="dateDay != null">date_day = #{dateDay},</if>
|
||||
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
|
||||
<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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -218,81 +278,4 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getPcsDataBySiteId" parameterType="Long" resultType="com.xzzn.ems.domain.vo.SiteMonitorDataVo">
|
||||
select CONCAT(date_month,'/',date_day) as ammeterDate,
|
||||
sum(daily_ac_charge_energy) as chargedCap,
|
||||
sum(daily_ac_discharge_energy) as disChargedCap
|
||||
from ems_pcs_data
|
||||
where site_id = #{siteId}
|
||||
and date_sub(CURDATE(), interval 6 day) <= create_time
|
||||
group by date_month,date_day
|
||||
</select>
|
||||
|
||||
<select id="getGridNrtPower" parameterType="Long" resultType="java.math.BigDecimal">
|
||||
select sum(total_active_power) as gridNrtPower
|
||||
from ems_pcs_data
|
||||
where site_id = #{siteId}
|
||||
</select>
|
||||
|
||||
<select id="getPcsTotalChargeData" resultType="map">
|
||||
select SUM(t.daily_ac_charge_energy) as totalChargedCap,
|
||||
SUM(t.daily_ac_discharge_energy) as totalDischargedCap
|
||||
from ems_pcs_data t
|
||||
where t.data_update_time = (select MAX(data_update_time) FROM ems_pcs_data
|
||||
where site_id = t.site_id and device_id = t.device_id and date_month = t.date_month and date_day = t.date_day)
|
||||
</select>
|
||||
|
||||
<select id="getSiteRunningHeadInfo" parameterType="Long" resultType="com.xzzn.ems.domain.vo.SiteMonitorRuningHeadInfoVo">
|
||||
select sum(a.total_active_power) as totalActivePower,
|
||||
sum(a.total_reactive_power) as totalReactivePower,
|
||||
sum(a.daily_ac_charge_energy) as dayChargedCap,
|
||||
sum(a.daily_ac_discharge_energy) as dayDisChargedCap
|
||||
from (
|
||||
select t.total_active_power,t.total_reactive_power,
|
||||
t.daily_ac_charge_energy,t.daily_ac_discharge_energy,
|
||||
t.device_id,t.site_id,t.create_time
|
||||
from ems_pcs_data t
|
||||
where t.site_id = #{siteId}
|
||||
and t.create_time = (select MAX(create_time) FROM ems_pcs_data where site_id = t.site_id and device_id = t.device_id)
|
||||
group by t.device_id,t.total_active_power, total_reactive_power,
|
||||
t.daily_ac_charge_energy,t.daily_ac_discharge_energy,t.site_id,t.create_time
|
||||
) a
|
||||
</select>
|
||||
|
||||
<select id="getElectDataList" resultType="com.xzzn.ems.domain.vo.ElectricIndexList">
|
||||
select tmp.date_month as dateMonth,
|
||||
SUM(tmp.daily_ac_charge_energy) as chargeEnergy,
|
||||
SUM(tmp.daily_ac_discharge_energy) as disChargeEnergy
|
||||
from
|
||||
(
|
||||
select date_month,date_day,
|
||||
t.daily_ac_charge_energy,t.daily_ac_discharge_energy,t.create_time
|
||||
from ems_pcs_data t
|
||||
where t.create_time = (select MAX(create_time) FROM ems_pcs_data where site_id = t.site_id
|
||||
and device_id = t.device_id and date_day = t.date_day and date_month = t.date_month)
|
||||
|
||||
) as tmp
|
||||
group by dateMonth
|
||||
</select>
|
||||
|
||||
<select id="getPcsDetailInfoBySiteId" parameterType="Long" resultType="com.xzzn.ems.domain.vo.PcsDetailInfoVo">
|
||||
select td.device_name as deviceName,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
|
||||
from ems_pcs_data tmp left join ems_devices_setting td on tmp.device_id = td.id and tmp.site_id = td.site_id
|
||||
where tmp.site_id = #{siteId}
|
||||
and tmp.data_update_time = (select MAX(data_update_time) FROM ems_pcs_data where site_id = tmp.site_id
|
||||
and device_id = tmp.device_id)
|
||||
order by tmp.device_id
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user