修改site_id & device_id
This commit is contained in:
@ -35,8 +35,8 @@
|
||||
<if test="alarmStartTime != null "> and alarm_start_time = #{alarmStartTime}</if>
|
||||
<if test="alarmEndTime != null "> and alarm_end_time = #{alarmEndTime}</if>
|
||||
<if test="status != null and status != ''"> and status = #{status}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="deviceName != null and deviceName != ''"> and device_name like concat('%', #{deviceName}, '%')</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -61,7 +61,7 @@
|
||||
<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="deviceName != null and deviceName != ''">device_name,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -77,7 +77,7 @@
|
||||
<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="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
@ -97,7 +97,7 @@
|
||||
<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="deviceName != null and deviceName != ''">device_name = #{deviceName},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
@ -114,7 +114,7 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAlarmRecordsBySiteId" parameterType="Long" resultType="com.xzzn.ems.domain.vo.SiteMonitorHomeAlarmVo">
|
||||
<select id="getAlarmRecordsBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.SiteMonitorHomeAlarmVo">
|
||||
select device_name as deviceName,
|
||||
status,alarm_content as alarmContent
|
||||
from ems_alarm_records
|
||||
|
@ -9,6 +9,7 @@
|
||||
<result property="dataUpdateTime" column="data_update_time" />
|
||||
<result property="category" column="category" />
|
||||
<result property="totalKwh" column="total_kwh" />
|
||||
<result property="sharpKwh" column="sharp_kwh" />
|
||||
<result property="peakKwh" column="peak_kwh" />
|
||||
<result property="flatKwh" column="flat_kwh" />
|
||||
<result property="valleyKwh" column="valley_kwh" />
|
||||
@ -22,7 +23,7 @@
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsAmmeterDataVo">
|
||||
select id, data_update_time, category, total_kwh, peak_kwh, flat_kwh, valley_kwh, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_ammeter_data
|
||||
select id, data_update_time, category, total_kwh, sharp_kwh, peak_kwh, flat_kwh, valley_kwh, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_ammeter_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsAmmeterDataList" parameterType="EmsAmmeterData" resultMap="EmsAmmeterDataResult">
|
||||
@ -31,11 +32,12 @@
|
||||
<if test="dataUpdateTime != null "> and data_update_time = #{dataUpdateTime}</if>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
<if test="totalKwh != null "> and total_kwh = #{totalKwh}</if>
|
||||
<if test="sharpKwh != null "> and sharp_kwh = #{sharpKwh}</if>
|
||||
<if test="peakKwh != null "> and peak_kwh = #{peakKwh}</if>
|
||||
<if test="flatKwh != null "> and flat_kwh = #{flatKwh}</if>
|
||||
<if test="valleyKwh != null "> and valley_kwh = #{valleyKwh}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -50,6 +52,7 @@
|
||||
<if test="dataUpdateTime != null">data_update_time,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="totalKwh != null">total_kwh,</if>
|
||||
<if test="sharpKwh != null">sharp_kwh,</if>
|
||||
<if test="peakKwh != null">peak_kwh,</if>
|
||||
<if test="flatKwh != null">flat_kwh,</if>
|
||||
<if test="valleyKwh != null">valley_kwh,</if>
|
||||
@ -59,12 +62,13 @@
|
||||
<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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="totalKwh != null">#{totalKwh},</if>
|
||||
<if test="sharpKwh != null">#{sharpKwh},</if>
|
||||
<if test="peakKwh != null">#{peakKwh},</if>
|
||||
<if test="flatKwh != null">#{flatKwh},</if>
|
||||
<if test="valleyKwh != null">#{valleyKwh},</if>
|
||||
@ -74,7 +78,7 @@
|
||||
<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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -84,6 +88,7 @@
|
||||
<if test="dataUpdateTime != null">data_update_time = #{dataUpdateTime},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="totalKwh != null">total_kwh = #{totalKwh},</if>
|
||||
<if test="sharpKwh != null">sharp_kwh = #{sharpKwh},</if>
|
||||
<if test="peakKwh != null">peak_kwh = #{peakKwh},</if>
|
||||
<if test="flatKwh != null">flat_kwh = #{flatKwh},</if>
|
||||
<if test="valleyKwh != null">valley_kwh = #{valleyKwh},</if>
|
||||
@ -93,7 +98,7 @@
|
||||
<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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -108,9 +113,11 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
<select id="getAmmeterDetailInfo" parameterType="Long" resultType="com.xzzn.ems.domain.vo.AmmeterDataDetailInfo">
|
||||
|
||||
<select id="getAmmeterDetailInfo" parameterType="String" resultType="com.xzzn.ems.domain.vo.AmmeterDataDetailInfo">
|
||||
select t.category as category,
|
||||
t.total_kwh as totalKwh,
|
||||
t.sharp_kwh as sharpKwh,
|
||||
t.flat_kwh as flatKwh,
|
||||
t.peak_kwh as peakKwh,
|
||||
t.valley_kwh as valleyKwh,
|
||||
|
@ -26,10 +26,43 @@
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="stackDeviceId" column="stack_device_id" />
|
||||
<result property="maxAllowedChargePower" column="max_allowed_charge_power" />
|
||||
<result property="maxAllowedDischargePower" column="max_allowed_discharge_power" />
|
||||
<result property="maxAllowedChargeVoltage" column="max_allowed_charge_voltage" />
|
||||
<result property="maxAllowedDischargeVoltage" column="max_allowed_discharge_voltage" />
|
||||
<result property="maxAllowedChargeCurrent" column="max_allowed_charge_current" />
|
||||
<result property="maxAllowedDischargeCurrent" column="max_allowed_discharge_current" />
|
||||
<result property="batteryPackVoltage" column="battery_pack_voltage" />
|
||||
<result property="batteryPackCurrent" column="battery_pack_current" />
|
||||
<result property="batteryPackTemp" column="battery_pack_temp" />
|
||||
<result property="batteryPackSoc" column="battery_pack_soc" />
|
||||
<result property="batteryPackSoh" column="battery_pack_soh" />
|
||||
<result property="batteryPackInsulationResistance" column="battery_pack_insulation_resistance" />
|
||||
<result property="avgCellVoltage" column="avg_cell_voltage" />
|
||||
<result property="avgCellTemp" column="avg_cell_temp" />
|
||||
<result property="maxCellVoltage" column="max_cell_voltage" />
|
||||
<result property="maxCellVoltageId" column="max_cell_voltage_id" />
|
||||
<result property="minCellVoltage" column="min_cell_voltage" />
|
||||
<result property="minCellVoltageId" column="min_cell_voltage_id" />
|
||||
<result property="maxCellTemp" column="max_cell_temp" />
|
||||
<result property="maxCellTempId" column="max_cell_temp_id" />
|
||||
<result property="minCellTemp" column="min_cell_temp" />
|
||||
<result property="minCellTempId" column="min_cell_temp_id" />
|
||||
<result property="maxCellSoc" column="max_cell_soc" />
|
||||
<result property="maxCellSocId" column="max_cell_soc_id" />
|
||||
<result property="minCellSoc" column="min_cell_soc" />
|
||||
<result property="minCellSocId" column="min_cell_soc_id" />
|
||||
<result property="maxCellSoh" column="max_cell_soh" />
|
||||
<result property="maxCellSohId" column="max_cell_soh_id" />
|
||||
<result property="minCellSoh" column="min_cell_soh" />
|
||||
<result property="minCellSohId" column="min_cell_soh_id" />
|
||||
<result property="totalChargeEnergy" column="total_charge_energy" />
|
||||
<result property="totalDischargeEnergy" column="total_discharge_energy" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBatteryClusterVo">
|
||||
select id, work_status, pcs_communication_status, ems_communication_status, cluster_voltage, chargeable_capacity, total_charged_capacity, cluster_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_battery_cluster
|
||||
select id, work_status, pcs_communication_status, ems_communication_status, cluster_voltage, chargeable_capacity, total_charged_capacity, cluster_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id, stack_device_id, max_allowed_charge_power, max_allowed_discharge_power, max_allowed_charge_voltage, max_allowed_discharge_voltage, max_allowed_charge_current, max_allowed_discharge_current, battery_pack_voltage, battery_pack_current, battery_pack_temp, battery_pack_soc, battery_pack_soh, battery_pack_insulation_resistance, avg_cell_voltage, avg_cell_temp, max_cell_voltage, max_cell_voltage_id, min_cell_voltage, min_cell_voltage_id, max_cell_temp, max_cell_temp_id, min_cell_temp, min_cell_temp_id, max_cell_soc, max_cell_soc_id, min_cell_soc, min_cell_soc_id, max_cell_soh, max_cell_soh_id, min_cell_soh, min_cell_soh_id, total_charge_energy, total_discharge_energy from ems_battery_cluster
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBatteryClusterList" parameterType="EmsBatteryCluster" resultMap="EmsBatteryClusterResult">
|
||||
@ -48,8 +81,41 @@
|
||||
<if test="averageTemperature != null "> and average_temperature = #{averageTemperature}</if>
|
||||
<if test="insulationResistance != null "> and insulation_resistance = #{insulationResistance}</if>
|
||||
<if test="currentSoc != null "> and current_soc = #{currentSoc}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="stackDeviceId != null and stackDeviceId != ''"> and stack_device_id = #{stackDeviceId}</if>
|
||||
<if test="maxAllowedChargePower != null "> and max_allowed_charge_power = #{maxAllowedChargePower}</if>
|
||||
<if test="maxAllowedDischargePower != null "> and max_allowed_discharge_power = #{maxAllowedDischargePower}</if>
|
||||
<if test="maxAllowedChargeVoltage != null "> and max_allowed_charge_voltage = #{maxAllowedChargeVoltage}</if>
|
||||
<if test="maxAllowedDischargeVoltage != null "> and max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage}</if>
|
||||
<if test="maxAllowedChargeCurrent != null "> and max_allowed_charge_current = #{maxAllowedChargeCurrent}</if>
|
||||
<if test="maxAllowedDischargeCurrent != null "> and max_allowed_discharge_current = #{maxAllowedDischargeCurrent}</if>
|
||||
<if test="batteryPackVoltage != null "> and battery_pack_voltage = #{batteryPackVoltage}</if>
|
||||
<if test="batteryPackCurrent != null "> and battery_pack_current = #{batteryPackCurrent}</if>
|
||||
<if test="batteryPackTemp != null "> and battery_pack_temp = #{batteryPackTemp}</if>
|
||||
<if test="batteryPackSoc != null "> and battery_pack_soc = #{batteryPackSoc}</if>
|
||||
<if test="batteryPackSoh != null "> and battery_pack_soh = #{batteryPackSoh}</if>
|
||||
<if test="batteryPackInsulationResistance != null "> and battery_pack_insulation_resistance = #{batteryPackInsulationResistance}</if>
|
||||
<if test="avgCellVoltage != null "> and avg_cell_voltage = #{avgCellVoltage}</if>
|
||||
<if test="avgCellTemp != null "> and avg_cell_temp = #{avgCellTemp}</if>
|
||||
<if test="maxCellVoltage != null "> and max_cell_voltage = #{maxCellVoltage}</if>
|
||||
<if test="maxCellVoltageId != null "> and max_cell_voltage_id = #{maxCellVoltageId}</if>
|
||||
<if test="minCellVoltage != null "> and min_cell_voltage = #{minCellVoltage}</if>
|
||||
<if test="minCellVoltageId != null "> and min_cell_voltage_id = #{minCellVoltageId}</if>
|
||||
<if test="maxCellTemp != null "> and max_cell_temp = #{maxCellTemp}</if>
|
||||
<if test="maxCellTempId != null "> and max_cell_temp_id = #{maxCellTempId}</if>
|
||||
<if test="minCellTemp != null "> and min_cell_temp = #{minCellTemp}</if>
|
||||
<if test="minCellTempId != null "> and min_cell_temp_id = #{minCellTempId}</if>
|
||||
<if test="maxCellSoc != null "> and max_cell_soc = #{maxCellSoc}</if>
|
||||
<if test="maxCellSocId != null "> and max_cell_soc_id = #{maxCellSocId}</if>
|
||||
<if test="minCellSoc != null "> and min_cell_soc = #{minCellSoc}</if>
|
||||
<if test="minCellSocId != null "> and min_cell_soc_id = #{minCellSocId}</if>
|
||||
<if test="maxCellSoh != null "> and max_cell_soh = #{maxCellSoh}</if>
|
||||
<if test="maxCellSohId != null "> and max_cell_soh_id = #{maxCellSohId}</if>
|
||||
<if test="minCellSoh != null "> and min_cell_soh = #{minCellSoh}</if>
|
||||
<if test="minCellSohId != null "> and min_cell_soh_id = #{minCellSohId}</if>
|
||||
<if test="totalChargeEnergy != null "> and total_charge_energy = #{totalChargeEnergy}</if>
|
||||
<if test="totalDischargeEnergy != null "> and total_discharge_energy = #{totalDischargeEnergy}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -80,7 +146,40 @@
|
||||
<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="stackDeviceId != null and stackDeviceId != ''">stack_device_id,</if>
|
||||
<if test="maxAllowedChargePower != null">max_allowed_charge_power,</if>
|
||||
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power,</if>
|
||||
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage,</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage,</if>
|
||||
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current,</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current,</if>
|
||||
<if test="batteryPackVoltage != null">battery_pack_voltage,</if>
|
||||
<if test="batteryPackCurrent != null">battery_pack_current,</if>
|
||||
<if test="batteryPackTemp != null">battery_pack_temp,</if>
|
||||
<if test="batteryPackSoc != null">battery_pack_soc,</if>
|
||||
<if test="batteryPackSoh != null">battery_pack_soh,</if>
|
||||
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance,</if>
|
||||
<if test="avgCellVoltage != null">avg_cell_voltage,</if>
|
||||
<if test="avgCellTemp != null">avg_cell_temp,</if>
|
||||
<if test="maxCellVoltage != null">max_cell_voltage,</if>
|
||||
<if test="maxCellVoltageId != null">max_cell_voltage_id,</if>
|
||||
<if test="minCellVoltage != null">min_cell_voltage,</if>
|
||||
<if test="minCellVoltageId != null">min_cell_voltage_id,</if>
|
||||
<if test="maxCellTemp != null">max_cell_temp,</if>
|
||||
<if test="maxCellTempId != null">max_cell_temp_id,</if>
|
||||
<if test="minCellTemp != null">min_cell_temp,</if>
|
||||
<if test="minCellTempId != null">min_cell_temp_id,</if>
|
||||
<if test="maxCellSoc != null">max_cell_soc,</if>
|
||||
<if test="maxCellSocId != null">max_cell_soc_id,</if>
|
||||
<if test="minCellSoc != null">min_cell_soc,</if>
|
||||
<if test="minCellSocId != null">min_cell_soc_id,</if>
|
||||
<if test="maxCellSoh != null">max_cell_soh,</if>
|
||||
<if test="maxCellSohId != null">max_cell_soh_id,</if>
|
||||
<if test="minCellSoh != null">min_cell_soh,</if>
|
||||
<if test="minCellSohId != null">min_cell_soh_id,</if>
|
||||
<if test="totalChargeEnergy != null">total_charge_energy,</if>
|
||||
<if test="totalDischargeEnergy != null">total_discharge_energy,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workStatus != null">#{workStatus},</if>
|
||||
@ -102,7 +201,40 @@
|
||||
<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="stackDeviceId != null and stackDeviceId != ''">#{stackDeviceId},</if>
|
||||
<if test="maxAllowedChargePower != null">#{maxAllowedChargePower},</if>
|
||||
<if test="maxAllowedDischargePower != null">#{maxAllowedDischargePower},</if>
|
||||
<if test="maxAllowedChargeVoltage != null">#{maxAllowedChargeVoltage},</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">#{maxAllowedDischargeVoltage},</if>
|
||||
<if test="maxAllowedChargeCurrent != null">#{maxAllowedChargeCurrent},</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">#{maxAllowedDischargeCurrent},</if>
|
||||
<if test="batteryPackVoltage != null">#{batteryPackVoltage},</if>
|
||||
<if test="batteryPackCurrent != null">#{batteryPackCurrent},</if>
|
||||
<if test="batteryPackTemp != null">#{batteryPackTemp},</if>
|
||||
<if test="batteryPackSoc != null">#{batteryPackSoc},</if>
|
||||
<if test="batteryPackSoh != null">#{batteryPackSoh},</if>
|
||||
<if test="batteryPackInsulationResistance != null">#{batteryPackInsulationResistance},</if>
|
||||
<if test="avgCellVoltage != null">#{avgCellVoltage},</if>
|
||||
<if test="avgCellTemp != null">#{avgCellTemp},</if>
|
||||
<if test="maxCellVoltage != null">#{maxCellVoltage},</if>
|
||||
<if test="maxCellVoltageId != null">#{maxCellVoltageId},</if>
|
||||
<if test="minCellVoltage != null">#{minCellVoltage},</if>
|
||||
<if test="minCellVoltageId != null">#{minCellVoltageId},</if>
|
||||
<if test="maxCellTemp != null">#{maxCellTemp},</if>
|
||||
<if test="maxCellTempId != null">#{maxCellTempId},</if>
|
||||
<if test="minCellTemp != null">#{minCellTemp},</if>
|
||||
<if test="minCellTempId != null">#{minCellTempId},</if>
|
||||
<if test="maxCellSoc != null">#{maxCellSoc},</if>
|
||||
<if test="maxCellSocId != null">#{maxCellSocId},</if>
|
||||
<if test="minCellSoc != null">#{minCellSoc},</if>
|
||||
<if test="minCellSocId != null">#{minCellSocId},</if>
|
||||
<if test="maxCellSoh != null">#{maxCellSoh},</if>
|
||||
<if test="maxCellSohId != null">#{maxCellSohId},</if>
|
||||
<if test="minCellSoh != null">#{minCellSoh},</if>
|
||||
<if test="minCellSohId != null">#{minCellSohId},</if>
|
||||
<if test="totalChargeEnergy != null">#{totalChargeEnergy},</if>
|
||||
<if test="totalDischargeEnergy != null">#{totalDischargeEnergy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -128,7 +260,40 @@
|
||||
<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="stackDeviceId != null and stackDeviceId != ''">stack_device_id = #{stackDeviceId},</if>
|
||||
<if test="maxAllowedChargePower != null">max_allowed_charge_power = #{maxAllowedChargePower},</if>
|
||||
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power = #{maxAllowedDischargePower},</if>
|
||||
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage = #{maxAllowedChargeVoltage},</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage},</if>
|
||||
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current = #{maxAllowedChargeCurrent},</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current = #{maxAllowedDischargeCurrent},</if>
|
||||
<if test="batteryPackVoltage != null">battery_pack_voltage = #{batteryPackVoltage},</if>
|
||||
<if test="batteryPackCurrent != null">battery_pack_current = #{batteryPackCurrent},</if>
|
||||
<if test="batteryPackTemp != null">battery_pack_temp = #{batteryPackTemp},</if>
|
||||
<if test="batteryPackSoc != null">battery_pack_soc = #{batteryPackSoc},</if>
|
||||
<if test="batteryPackSoh != null">battery_pack_soh = #{batteryPackSoh},</if>
|
||||
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance = #{batteryPackInsulationResistance},</if>
|
||||
<if test="avgCellVoltage != null">avg_cell_voltage = #{avgCellVoltage},</if>
|
||||
<if test="avgCellTemp != null">avg_cell_temp = #{avgCellTemp},</if>
|
||||
<if test="maxCellVoltage != null">max_cell_voltage = #{maxCellVoltage},</if>
|
||||
<if test="maxCellVoltageId != null">max_cell_voltage_id = #{maxCellVoltageId},</if>
|
||||
<if test="minCellVoltage != null">min_cell_voltage = #{minCellVoltage},</if>
|
||||
<if test="minCellVoltageId != null">min_cell_voltage_id = #{minCellVoltageId},</if>
|
||||
<if test="maxCellTemp != null">max_cell_temp = #{maxCellTemp},</if>
|
||||
<if test="maxCellTempId != null">max_cell_temp_id = #{maxCellTempId},</if>
|
||||
<if test="minCellTemp != null">min_cell_temp = #{minCellTemp},</if>
|
||||
<if test="minCellTempId != null">min_cell_temp_id = #{minCellTempId},</if>
|
||||
<if test="maxCellSoc != null">max_cell_soc = #{maxCellSoc},</if>
|
||||
<if test="maxCellSocId != null">max_cell_soc_id = #{maxCellSocId},</if>
|
||||
<if test="minCellSoc != null">min_cell_soc = #{minCellSoc},</if>
|
||||
<if test="minCellSocId != null">min_cell_soc_id = #{minCellSocId},</if>
|
||||
<if test="maxCellSoh != null">max_cell_soh = #{maxCellSoh},</if>
|
||||
<if test="maxCellSohId != null">max_cell_soh_id = #{maxCellSohId},</if>
|
||||
<if test="minCellSoh != null">min_cell_soh = #{minCellSoh},</if>
|
||||
<if test="minCellSohId != null">min_cell_soh_id = #{minCellSohId},</if>
|
||||
<if test="totalChargeEnergy != null">total_charge_energy = #{totalChargeEnergy},</if>
|
||||
<if test="totalDischargeEnergy != null">total_discharge_energy = #{totalDischargeEnergy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -144,7 +309,7 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getBMSBatteryCluster" parameterType="Long" resultType="com.xzzn.ems.domain.vo.BMSBatteryClusterVo">
|
||||
<select id="getBMSBatteryCluster" parameterType="String" resultType="com.xzzn.ems.domain.vo.BMSBatteryClusterVo">
|
||||
select td.device_name as deviceName, tmp.work_status as workStatus,
|
||||
tmp.pcs_communication_status as pcsCommunicationStatus, tmp.ems_communication_status as emsCommunicationStatus,
|
||||
tmp.cluster_voltage as clusterVoltage,tmp.chargeable_capacity as chargeableCapacity, tmp.total_charged_capacity as totalChargedCapacity,
|
||||
|
@ -39,9 +39,9 @@
|
||||
<if test="soc != null "> and soc = #{soc}</if>
|
||||
<if test="soh != null "> and soh = #{soh}</if>
|
||||
<if test="dataTimestamp != null "> and data_timestamp = #{dataTimestamp}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="clusterDeviceId != null "> and cluster_device_id = #{clusterDeviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="clusterDeviceId != null and clusterDeviceId != ''"> and cluster_device_id = #{clusterDeviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -67,8 +67,8 @@
|
||||
<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="clusterDeviceId != null">cluster_device_id,</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
<if test="clusterDeviceId != null and clusterDeviceId != ''">cluster_device_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="batteryPack != null">#{batteryPack},</if>
|
||||
@ -85,8 +85,8 @@
|
||||
<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="clusterDeviceId != null">#{clusterDeviceId},</if>
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
<if test="clusterDeviceId != null and clusterDeviceId != ''">#{clusterDeviceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -107,8 +107,8 @@
|
||||
<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="clusterDeviceId != null">cluster_device_id = #{clusterDeviceId},</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
<if test="clusterDeviceId != null and clusterDeviceId != ''">cluster_device_id = #{clusterDeviceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -124,7 +124,7 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getBatteryDataBySiteId" parameterType="Long" resultMap="EmsBatteryDataResult">
|
||||
<select id="getBatteryDataBySiteId" parameterType="String" resultMap="EmsBatteryDataResult">
|
||||
<include refid="selectEmsBatteryDataVo"/>
|
||||
where site_id = #{siteId}
|
||||
and DATE(data_timestamp) = DATE(NOW())
|
||||
|
@ -26,10 +26,42 @@
|
||||
<result property="remark" column="remark" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="maxAllowedChargePower" column="max_allowed_charge_power" />
|
||||
<result property="maxAllowedDischargePower" column="max_allowed_discharge_power" />
|
||||
<result property="maxAllowedChargeVoltage" column="max_allowed_charge_voltage" />
|
||||
<result property="maxAllowedDischargeVoltage" column="max_allowed_discharge_voltage" />
|
||||
<result property="maxAllowedChargeCurrent" column="max_allowed_charge_current" />
|
||||
<result property="maxAllowedDischargeCurrent" column="max_allowed_discharge_current" />
|
||||
<result property="batteryPackVoltage" column="battery_pack_voltage" />
|
||||
<result property="batteryPackCurrent" column="battery_pack_current" />
|
||||
<result property="batteryPackTemp" column="battery_pack_temp" />
|
||||
<result property="batteryPackSoc" column="battery_pack_soc" />
|
||||
<result property="batteryPackSoh" column="battery_pack_soh" />
|
||||
<result property="batteryPackInsulationResistance" column="battery_pack_insulation_resistance" />
|
||||
<result property="avgCellVoltage" column="avg_cell_voltage" />
|
||||
<result property="avgCellTemp" column="avg_cell_temp" />
|
||||
<result property="maxCellVoltage" column="max_cell_voltage" />
|
||||
<result property="maxCellVoltageId" column="max_cell_voltage_id" />
|
||||
<result property="minCellVoltage" column="min_cell_voltage" />
|
||||
<result property="minCellVoltageId" column="min_cell_voltage_id" />
|
||||
<result property="maxCellTemp" column="max_cell_temp" />
|
||||
<result property="maxCellTempId" column="max_cell_temp_id" />
|
||||
<result property="minCellTemp" column="min_cell_temp" />
|
||||
<result property="minCellTempId" column="min_cell_temp_id" />
|
||||
<result property="maxCellSoc" column="max_cell_soc" />
|
||||
<result property="maxCellSocId" column="max_cell_soc_id" />
|
||||
<result property="minCellSoc" column="min_cell_soc" />
|
||||
<result property="minCellSocId" column="min_cell_soc_id" />
|
||||
<result property="maxCellSoh" column="max_cell_soh" />
|
||||
<result property="maxCellSohId" column="max_cell_soh_id" />
|
||||
<result property="minCellSoh" column="min_cell_soh" />
|
||||
<result property="minCellSohId" column="min_cell_soh_id" />
|
||||
<result property="totalChargeEnergy" column="total_charge_energy" />
|
||||
<result property="totalDischargeEnergy" column="total_discharge_energy" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBatteryStackVo">
|
||||
select id, work_status, pcs_communication_status, ems_communication_status, total_voltage, chargeable_capacity, total_charged_capacity, total_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id from ems_battery_stack
|
||||
select id, work_status, pcs_communication_status, ems_communication_status, total_voltage, chargeable_capacity, total_charged_capacity, total_current, dischargeable_capacity, total_discharged_capacity, soh, average_temperature, insulation_resistance, current_soc, create_by, create_time, update_by, update_time, remark, site_id, device_id, max_allowed_charge_power, max_allowed_discharge_power, max_allowed_charge_voltage, max_allowed_discharge_voltage, max_allowed_charge_current, max_allowed_discharge_current, battery_pack_voltage, battery_pack_current, battery_pack_temp, battery_pack_soc, battery_pack_soh, battery_pack_insulation_resistance, avg_cell_voltage, avg_cell_temp, max_cell_voltage, max_cell_voltage_id, min_cell_voltage, min_cell_voltage_id, max_cell_temp, max_cell_temp_id, min_cell_temp, min_cell_temp_id, max_cell_soc, max_cell_soc_id, min_cell_soc, min_cell_soc_id, max_cell_soh, max_cell_soh_id, min_cell_soh, min_cell_soh_id, total_charge_energy, total_discharge_energy from ems_battery_stack
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBatteryStackList" parameterType="EmsBatteryStack" resultMap="EmsBatteryStackResult">
|
||||
@ -48,8 +80,40 @@
|
||||
<if test="averageTemperature != null "> and average_temperature = #{averageTemperature}</if>
|
||||
<if test="insulationResistance != null "> and insulation_resistance = #{insulationResistance}</if>
|
||||
<if test="currentSoc != null "> and current_soc = #{currentSoc}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="maxAllowedChargePower != null "> and max_allowed_charge_power = #{maxAllowedChargePower}</if>
|
||||
<if test="maxAllowedDischargePower != null "> and max_allowed_discharge_power = #{maxAllowedDischargePower}</if>
|
||||
<if test="maxAllowedChargeVoltage != null "> and max_allowed_charge_voltage = #{maxAllowedChargeVoltage}</if>
|
||||
<if test="maxAllowedDischargeVoltage != null "> and max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage}</if>
|
||||
<if test="maxAllowedChargeCurrent != null "> and max_allowed_charge_current = #{maxAllowedChargeCurrent}</if>
|
||||
<if test="maxAllowedDischargeCurrent != null "> and max_allowed_discharge_current = #{maxAllowedDischargeCurrent}</if>
|
||||
<if test="batteryPackVoltage != null "> and battery_pack_voltage = #{batteryPackVoltage}</if>
|
||||
<if test="batteryPackCurrent != null "> and battery_pack_current = #{batteryPackCurrent}</if>
|
||||
<if test="batteryPackTemp != null "> and battery_pack_temp = #{batteryPackTemp}</if>
|
||||
<if test="batteryPackSoc != null "> and battery_pack_soc = #{batteryPackSoc}</if>
|
||||
<if test="batteryPackSoh != null "> and battery_pack_soh = #{batteryPackSoh}</if>
|
||||
<if test="batteryPackInsulationResistance != null "> and battery_pack_insulation_resistance = #{batteryPackInsulationResistance}</if>
|
||||
<if test="avgCellVoltage != null "> and avg_cell_voltage = #{avgCellVoltage}</if>
|
||||
<if test="avgCellTemp != null "> and avg_cell_temp = #{avgCellTemp}</if>
|
||||
<if test="maxCellVoltage != null "> and max_cell_voltage = #{maxCellVoltage}</if>
|
||||
<if test="maxCellVoltageId != null "> and max_cell_voltage_id = #{maxCellVoltageId}</if>
|
||||
<if test="minCellVoltage != null "> and min_cell_voltage = #{minCellVoltage}</if>
|
||||
<if test="minCellVoltageId != null "> and min_cell_voltage_id = #{minCellVoltageId}</if>
|
||||
<if test="maxCellTemp != null "> and max_cell_temp = #{maxCellTemp}</if>
|
||||
<if test="maxCellTempId != null "> and max_cell_temp_id = #{maxCellTempId}</if>
|
||||
<if test="minCellTemp != null "> and min_cell_temp = #{minCellTemp}</if>
|
||||
<if test="minCellTempId != null "> and min_cell_temp_id = #{minCellTempId}</if>
|
||||
<if test="maxCellSoc != null "> and max_cell_soc = #{maxCellSoc}</if>
|
||||
<if test="maxCellSocId != null "> and max_cell_soc_id = #{maxCellSocId}</if>
|
||||
<if test="minCellSoc != null "> and min_cell_soc = #{minCellSoc}</if>
|
||||
<if test="minCellSocId != null "> and min_cell_soc_id = #{minCellSocId}</if>
|
||||
<if test="maxCellSoh != null "> and max_cell_soh = #{maxCellSoh}</if>
|
||||
<if test="maxCellSohId != null "> and max_cell_soh_id = #{maxCellSohId}</if>
|
||||
<if test="minCellSoh != null "> and min_cell_soh = #{minCellSoh}</if>
|
||||
<if test="minCellSohId != null "> and min_cell_soh_id = #{minCellSohId}</if>
|
||||
<if test="totalChargeEnergy != null "> and total_charge_energy = #{totalChargeEnergy}</if>
|
||||
<if test="totalDischargeEnergy != null "> and total_discharge_energy = #{totalDischargeEnergy}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -80,7 +144,39 @@
|
||||
<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="maxAllowedChargePower != null">max_allowed_charge_power,</if>
|
||||
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power,</if>
|
||||
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage,</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage,</if>
|
||||
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current,</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current,</if>
|
||||
<if test="batteryPackVoltage != null">battery_pack_voltage,</if>
|
||||
<if test="batteryPackCurrent != null">battery_pack_current,</if>
|
||||
<if test="batteryPackTemp != null">battery_pack_temp,</if>
|
||||
<if test="batteryPackSoc != null">battery_pack_soc,</if>
|
||||
<if test="batteryPackSoh != null">battery_pack_soh,</if>
|
||||
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance,</if>
|
||||
<if test="avgCellVoltage != null">avg_cell_voltage,</if>
|
||||
<if test="avgCellTemp != null">avg_cell_temp,</if>
|
||||
<if test="maxCellVoltage != null">max_cell_voltage,</if>
|
||||
<if test="maxCellVoltageId != null">max_cell_voltage_id,</if>
|
||||
<if test="minCellVoltage != null">min_cell_voltage,</if>
|
||||
<if test="minCellVoltageId != null">min_cell_voltage_id,</if>
|
||||
<if test="maxCellTemp != null">max_cell_temp,</if>
|
||||
<if test="maxCellTempId != null">max_cell_temp_id,</if>
|
||||
<if test="minCellTemp != null">min_cell_temp,</if>
|
||||
<if test="minCellTempId != null">min_cell_temp_id,</if>
|
||||
<if test="maxCellSoc != null">max_cell_soc,</if>
|
||||
<if test="maxCellSocId != null">max_cell_soc_id,</if>
|
||||
<if test="minCellSoc != null">min_cell_soc,</if>
|
||||
<if test="minCellSocId != null">min_cell_soc_id,</if>
|
||||
<if test="maxCellSoh != null">max_cell_soh,</if>
|
||||
<if test="maxCellSohId != null">max_cell_soh_id,</if>
|
||||
<if test="minCellSoh != null">min_cell_soh,</if>
|
||||
<if test="minCellSohId != null">min_cell_soh_id,</if>
|
||||
<if test="totalChargeEnergy != null">total_charge_energy,</if>
|
||||
<if test="totalDischargeEnergy != null">total_discharge_energy,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="workStatus != null">#{workStatus},</if>
|
||||
@ -102,7 +198,39 @@
|
||||
<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="maxAllowedChargePower != null">#{maxAllowedChargePower},</if>
|
||||
<if test="maxAllowedDischargePower != null">#{maxAllowedDischargePower},</if>
|
||||
<if test="maxAllowedChargeVoltage != null">#{maxAllowedChargeVoltage},</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">#{maxAllowedDischargeVoltage},</if>
|
||||
<if test="maxAllowedChargeCurrent != null">#{maxAllowedChargeCurrent},</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">#{maxAllowedDischargeCurrent},</if>
|
||||
<if test="batteryPackVoltage != null">#{batteryPackVoltage},</if>
|
||||
<if test="batteryPackCurrent != null">#{batteryPackCurrent},</if>
|
||||
<if test="batteryPackTemp != null">#{batteryPackTemp},</if>
|
||||
<if test="batteryPackSoc != null">#{batteryPackSoc},</if>
|
||||
<if test="batteryPackSoh != null">#{batteryPackSoh},</if>
|
||||
<if test="batteryPackInsulationResistance != null">#{batteryPackInsulationResistance},</if>
|
||||
<if test="avgCellVoltage != null">#{avgCellVoltage},</if>
|
||||
<if test="avgCellTemp != null">#{avgCellTemp},</if>
|
||||
<if test="maxCellVoltage != null">#{maxCellVoltage},</if>
|
||||
<if test="maxCellVoltageId != null">#{maxCellVoltageId},</if>
|
||||
<if test="minCellVoltage != null">#{minCellVoltage},</if>
|
||||
<if test="minCellVoltageId != null">#{minCellVoltageId},</if>
|
||||
<if test="maxCellTemp != null">#{maxCellTemp},</if>
|
||||
<if test="maxCellTempId != null">#{maxCellTempId},</if>
|
||||
<if test="minCellTemp != null">#{minCellTemp},</if>
|
||||
<if test="minCellTempId != null">#{minCellTempId},</if>
|
||||
<if test="maxCellSoc != null">#{maxCellSoc},</if>
|
||||
<if test="maxCellSocId != null">#{maxCellSocId},</if>
|
||||
<if test="minCellSoc != null">#{minCellSoc},</if>
|
||||
<if test="minCellSocId != null">#{minCellSocId},</if>
|
||||
<if test="maxCellSoh != null">#{maxCellSoh},</if>
|
||||
<if test="maxCellSohId != null">#{maxCellSohId},</if>
|
||||
<if test="minCellSoh != null">#{minCellSoh},</if>
|
||||
<if test="minCellSohId != null">#{minCellSohId},</if>
|
||||
<if test="totalChargeEnergy != null">#{totalChargeEnergy},</if>
|
||||
<if test="totalDischargeEnergy != null">#{totalDischargeEnergy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -128,7 +256,39 @@
|
||||
<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="maxAllowedChargePower != null">max_allowed_charge_power = #{maxAllowedChargePower},</if>
|
||||
<if test="maxAllowedDischargePower != null">max_allowed_discharge_power = #{maxAllowedDischargePower},</if>
|
||||
<if test="maxAllowedChargeVoltage != null">max_allowed_charge_voltage = #{maxAllowedChargeVoltage},</if>
|
||||
<if test="maxAllowedDischargeVoltage != null">max_allowed_discharge_voltage = #{maxAllowedDischargeVoltage},</if>
|
||||
<if test="maxAllowedChargeCurrent != null">max_allowed_charge_current = #{maxAllowedChargeCurrent},</if>
|
||||
<if test="maxAllowedDischargeCurrent != null">max_allowed_discharge_current = #{maxAllowedDischargeCurrent},</if>
|
||||
<if test="batteryPackVoltage != null">battery_pack_voltage = #{batteryPackVoltage},</if>
|
||||
<if test="batteryPackCurrent != null">battery_pack_current = #{batteryPackCurrent},</if>
|
||||
<if test="batteryPackTemp != null">battery_pack_temp = #{batteryPackTemp},</if>
|
||||
<if test="batteryPackSoc != null">battery_pack_soc = #{batteryPackSoc},</if>
|
||||
<if test="batteryPackSoh != null">battery_pack_soh = #{batteryPackSoh},</if>
|
||||
<if test="batteryPackInsulationResistance != null">battery_pack_insulation_resistance = #{batteryPackInsulationResistance},</if>
|
||||
<if test="avgCellVoltage != null">avg_cell_voltage = #{avgCellVoltage},</if>
|
||||
<if test="avgCellTemp != null">avg_cell_temp = #{avgCellTemp},</if>
|
||||
<if test="maxCellVoltage != null">max_cell_voltage = #{maxCellVoltage},</if>
|
||||
<if test="maxCellVoltageId != null">max_cell_voltage_id = #{maxCellVoltageId},</if>
|
||||
<if test="minCellVoltage != null">min_cell_voltage = #{minCellVoltage},</if>
|
||||
<if test="minCellVoltageId != null">min_cell_voltage_id = #{minCellVoltageId},</if>
|
||||
<if test="maxCellTemp != null">max_cell_temp = #{maxCellTemp},</if>
|
||||
<if test="maxCellTempId != null">max_cell_temp_id = #{maxCellTempId},</if>
|
||||
<if test="minCellTemp != null">min_cell_temp = #{minCellTemp},</if>
|
||||
<if test="minCellTempId != null">min_cell_temp_id = #{minCellTempId},</if>
|
||||
<if test="maxCellSoc != null">max_cell_soc = #{maxCellSoc},</if>
|
||||
<if test="maxCellSocId != null">max_cell_soc_id = #{maxCellSocId},</if>
|
||||
<if test="minCellSoc != null">min_cell_soc = #{minCellSoc},</if>
|
||||
<if test="minCellSocId != null">min_cell_soc_id = #{minCellSocId},</if>
|
||||
<if test="maxCellSoh != null">max_cell_soh = #{maxCellSoh},</if>
|
||||
<if test="maxCellSohId != null">max_cell_soh_id = #{maxCellSohId},</if>
|
||||
<if test="minCellSoh != null">min_cell_soh = #{minCellSoh},</if>
|
||||
<if test="minCellSohId != null">min_cell_soh_id = #{minCellSohId},</if>
|
||||
<if test="totalChargeEnergy != null">total_charge_energy = #{totalChargeEnergy},</if>
|
||||
<if test="totalDischargeEnergy != null">total_discharge_energy = #{totalDischargeEnergy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -144,7 +304,7 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="selectEmsBatteryStackBySiteId" parameterType="Long" resultType="com.xzzn.ems.domain.vo.BMSOverViewVo">
|
||||
<select id="selectEmsBatteryStackBySiteId" parameterType="String" resultType="com.xzzn.ems.domain.vo.BMSOverViewVo">
|
||||
select td.device_name as deviceName,tmp.work_status as workStatus,
|
||||
tmp.pcs_communication_status as pcsCommunicationStatus,tmp.ems_communication_status as emsCommunicationStatus,
|
||||
tmp.total_voltage as totalVoltage,tmp.chargeable_capacity as chargeableCapacity,tmp.total_charged_capacity as totalChargedCapacity,
|
||||
|
@ -40,8 +40,8 @@
|
||||
<if test="heatingStopPoint != null "> and heating_stop_point = #{heatingStopPoint}</if>
|
||||
<if test="coolingStopPoint != null "> and cooling_stop_point = #{coolingStopPoint}</if>
|
||||
<if test="lowTempAlarmPoint != null "> and low_temp_alarm_point = #{lowTempAlarmPoint}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -68,7 +68,7 @@
|
||||
<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>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="systemName != null">#{systemName},</if>
|
||||
@ -86,7 +86,7 @@
|
||||
<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>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -108,7 +108,7 @@
|
||||
<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>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -124,10 +124,10 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getCoolingDataList" parameterType="Long" resultMap="EmsCoolingDataResult">
|
||||
<select id="getCoolingDataList" parameterType="String" resultMap="EmsCoolingDataResult">
|
||||
select t.*
|
||||
from ems_cooling_data t
|
||||
where t.site_id = 1
|
||||
where t.site_id = #{siteId}
|
||||
and t.update_time = (
|
||||
select MAX(tcd.update_time) from ems_cooling_data tcd where tcd.site_id = t.site_id and tcd.device_id = t.device_id)
|
||||
order by t.system_name
|
||||
|
@ -23,10 +23,11 @@
|
||||
<result property="updatedAt" column="updated_at" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="communicationStatus" column="communication_status" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsDevicesSettingVo">
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status from ems_devices_setting
|
||||
select id, device_name, device_type, slave_id, timeout_ms, retries, ip_address, ip_port, serial_port, baud_rate, data_bits, stop_bits, parity, description, created_at, updated_at, site_id, communication_status, device_id from ems_devices_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsDevicesSettingList" parameterType="EmsDevicesSetting" resultMap="EmsDevicesSettingResult">
|
||||
@ -47,8 +48,9 @@
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="createdAt != null "> and created_at = #{createdAt}</if>
|
||||
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="communicationStatus != null and communicationStatus != ''"> and communication_status = #{communicationStatus}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -77,6 +79,7 @@
|
||||
<if test="updatedAt != null">updated_at,</if>
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="communicationStatus != null">communication_status,</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceName != null and deviceName != ''">#{deviceName},</if>
|
||||
@ -96,6 +99,7 @@
|
||||
<if test="updatedAt != null">#{updatedAt},</if>
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="communicationStatus != null">#{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -119,6 +123,7 @@
|
||||
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="communicationStatus != null">communication_status = #{communicationStatus},</if>
|
||||
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -134,21 +139,21 @@
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getAllStackInfoBySiteId" parameterType="Long" resultType="java.util.Map">
|
||||
select id,device_name as deviceName from ems_devices_setting
|
||||
where id in (
|
||||
<select id="getAllStackInfoBySiteId" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,device_name as deviceName from ems_devices_setting
|
||||
where device_id in (
|
||||
select distinct eb.device_id from ems_battery_stack eb where eb.site_id = #{siteId})
|
||||
</select>
|
||||
|
||||
<select id="getAllClusterInfoByStackId" parameterType="Long" resultType="java.util.Map">
|
||||
select id,device_name as deviceName
|
||||
<select id="getAllClusterInfoByStackId" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,device_name as deviceName
|
||||
from ems_devices_setting
|
||||
where id in (select distinct eb.device_id from ems_battery_cluster eb where eb.stack_device_id = #{stackDeviceId})
|
||||
where device_id in (select distinct eb.device_id from ems_battery_cluster eb where eb.stack_device_id = #{stackDeviceId})
|
||||
</select>
|
||||
|
||||
<select id="getDeviceStatus" parameterType="Long" resultType="java.util.Map">
|
||||
select id,communication_status
|
||||
<select id="getDeviceStatus" parameterType="String" resultType="java.util.Map">
|
||||
select device_id as id,communication_status
|
||||
from ems_devices_setting
|
||||
where id = #{deviceId}
|
||||
where device_id = #{deviceId}
|
||||
</select>
|
||||
</mapper>
|
@ -18,10 +18,30 @@
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="branchId" column="branch_id" />
|
||||
<result property="gridUVoltage" column="grid_u_voltage" />
|
||||
<result property="gridVVoltage" column="grid_v_voltage" />
|
||||
<result property="gridWVoltage" column="grid_w_voltage" />
|
||||
<result property="outputUCurrent" column="output_u_current" />
|
||||
<result property="outputVCurrent" column="output_v_current" />
|
||||
<result property="outputWCurrent" column="output_w_current" />
|
||||
<result property="apparentPower" column="apparent_power" />
|
||||
<result property="activePower" column="active_power" />
|
||||
<result property="reactivePower" column="reactive_power" />
|
||||
<result property="powerFactor" column="power_factor" />
|
||||
<result property="frequency" column="frequency" />
|
||||
<result property="internalTemp" column="internal_temp" />
|
||||
<result property="uIgbtTemp" column="u_igbt_temp" />
|
||||
<result property="vIgbtTemp" column="v_igbt_temp" />
|
||||
<result property="wIgbtTemp" column="w_igbt_temp" />
|
||||
<result property="gridStatus" column="grid_status" />
|
||||
<result property="availablePower" column="available_power" />
|
||||
<result property="totalLoadRatio" column="total_load_ratio" />
|
||||
<result property="acLeakageCurrent" column="ac_leakage_current" />
|
||||
<result property="insulationResistance" column="insulation_resistance" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsPcsBranchDataVo">
|
||||
select id, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, branch_id from ems_pcs_branch_data
|
||||
select id, discharge_status, dc_power, dc_voltage, dc_current, create_by, create_time, update_by, update_time, remark, site_id, device_id, branch_id, grid_u_voltage, grid_v_voltage, grid_w_voltage, output_u_current, output_v_current, output_w_current, apparent_power, active_power, reactive_power, power_factor, frequency, internal_temp, u_igbt_temp, v_igbt_temp, w_igbt_temp, grid_status, available_power, total_load_ratio, ac_leakage_current, insulation_resistance from ems_pcs_branch_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPcsBranchDataList" parameterType="EmsPcsBranchData" resultMap="EmsPcsBranchDataResult">
|
||||
@ -31,9 +51,29 @@
|
||||
<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>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null "> and device_id = #{deviceId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="branchId != null "> and branch_id = #{branchId}</if>
|
||||
<if test="gridUVoltage != null "> and grid_u_voltage = #{gridUVoltage}</if>
|
||||
<if test="gridVVoltage != null "> and grid_v_voltage = #{gridVVoltage}</if>
|
||||
<if test="gridWVoltage != null "> and grid_w_voltage = #{gridWVoltage}</if>
|
||||
<if test="outputUCurrent != null "> and output_u_current = #{outputUCurrent}</if>
|
||||
<if test="outputVCurrent != null "> and output_v_current = #{outputVCurrent}</if>
|
||||
<if test="outputWCurrent != null "> and output_w_current = #{outputWCurrent}</if>
|
||||
<if test="apparentPower != null "> and apparent_power = #{apparentPower}</if>
|
||||
<if test="activePower != null "> and active_power = #{activePower}</if>
|
||||
<if test="reactivePower != null "> and reactive_power = #{reactivePower}</if>
|
||||
<if test="powerFactor != null "> and power_factor = #{powerFactor}</if>
|
||||
<if test="frequency != null "> and frequency = #{frequency}</if>
|
||||
<if test="internalTemp != null "> and internal_temp = #{internalTemp}</if>
|
||||
<if test="uIgbtTemp != null "> and u_igbt_temp = #{uIgbtTemp}</if>
|
||||
<if test="vIgbtTemp != null "> and v_igbt_temp = #{vIgbtTemp}</if>
|
||||
<if test="wIgbtTemp != null "> and w_igbt_temp = #{wIgbtTemp}</if>
|
||||
<if test="gridStatus != null and gridStatus != ''"> and grid_status = #{gridStatus}</if>
|
||||
<if test="availablePower != null "> and available_power = #{availablePower}</if>
|
||||
<if test="totalLoadRatio != null "> and total_load_ratio = #{totalLoadRatio}</if>
|
||||
<if test="acLeakageCurrent != null "> and ac_leakage_current = #{acLeakageCurrent}</if>
|
||||
<if test="insulationResistance != null "> and insulation_resistance = #{insulationResistance}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -55,8 +95,28 @@
|
||||
<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="branchId != null">branch_id,</if>
|
||||
<if test="gridUVoltage != null">grid_u_voltage,</if>
|
||||
<if test="gridVVoltage != null">grid_v_voltage,</if>
|
||||
<if test="gridWVoltage != null">grid_w_voltage,</if>
|
||||
<if test="outputUCurrent != null">output_u_current,</if>
|
||||
<if test="outputVCurrent != null">output_v_current,</if>
|
||||
<if test="outputWCurrent != null">output_w_current,</if>
|
||||
<if test="apparentPower != null">apparent_power,</if>
|
||||
<if test="activePower != null">active_power,</if>
|
||||
<if test="reactivePower != null">reactive_power,</if>
|
||||
<if test="powerFactor != null">power_factor,</if>
|
||||
<if test="frequency != null">frequency,</if>
|
||||
<if test="internalTemp != null">internal_temp,</if>
|
||||
<if test="uIgbtTemp != null">u_igbt_temp,</if>
|
||||
<if test="vIgbtTemp != null">v_igbt_temp,</if>
|
||||
<if test="wIgbtTemp != null">w_igbt_temp,</if>
|
||||
<if test="gridStatus != null">grid_status,</if>
|
||||
<if test="availablePower != null">available_power,</if>
|
||||
<if test="totalLoadRatio != null">total_load_ratio,</if>
|
||||
<if test="acLeakageCurrent != null">ac_leakage_current,</if>
|
||||
<if test="insulationResistance != null">insulation_resistance,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dischargeStatus != null">#{dischargeStatus},</if>
|
||||
@ -69,8 +129,28 @@
|
||||
<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="branchId != null">#{branchId},</if>
|
||||
<if test="gridUVoltage != null">#{gridUVoltage},</if>
|
||||
<if test="gridVVoltage != null">#{gridVVoltage},</if>
|
||||
<if test="gridWVoltage != null">#{gridWVoltage},</if>
|
||||
<if test="outputUCurrent != null">#{outputUCurrent},</if>
|
||||
<if test="outputVCurrent != null">#{outputVCurrent},</if>
|
||||
<if test="outputWCurrent != null">#{outputWCurrent},</if>
|
||||
<if test="apparentPower != null">#{apparentPower},</if>
|
||||
<if test="activePower != null">#{activePower},</if>
|
||||
<if test="reactivePower != null">#{reactivePower},</if>
|
||||
<if test="powerFactor != null">#{powerFactor},</if>
|
||||
<if test="frequency != null">#{frequency},</if>
|
||||
<if test="internalTemp != null">#{internalTemp},</if>
|
||||
<if test="uIgbtTemp != null">#{uIgbtTemp},</if>
|
||||
<if test="vIgbtTemp != null">#{vIgbtTemp},</if>
|
||||
<if test="wIgbtTemp != null">#{wIgbtTemp},</if>
|
||||
<if test="gridStatus != null">#{gridStatus},</if>
|
||||
<if test="availablePower != null">#{availablePower},</if>
|
||||
<if test="totalLoadRatio != null">#{totalLoadRatio},</if>
|
||||
<if test="acLeakageCurrent != null">#{acLeakageCurrent},</if>
|
||||
<if test="insulationResistance != null">#{insulationResistance},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -87,8 +167,28 @@
|
||||
<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="branchId != null">branch_id = #{branchId},</if>
|
||||
<if test="gridUVoltage != null">grid_u_voltage = #{gridUVoltage},</if>
|
||||
<if test="gridVVoltage != null">grid_v_voltage = #{gridVVoltage},</if>
|
||||
<if test="gridWVoltage != null">grid_w_voltage = #{gridWVoltage},</if>
|
||||
<if test="outputUCurrent != null">output_u_current = #{outputUCurrent},</if>
|
||||
<if test="outputVCurrent != null">output_v_current = #{outputVCurrent},</if>
|
||||
<if test="outputWCurrent != null">output_w_current = #{outputWCurrent},</if>
|
||||
<if test="apparentPower != null">apparent_power = #{apparentPower},</if>
|
||||
<if test="activePower != null">active_power = #{activePower},</if>
|
||||
<if test="reactivePower != null">reactive_power = #{reactivePower},</if>
|
||||
<if test="powerFactor != null">power_factor = #{powerFactor},</if>
|
||||
<if test="frequency != null">frequency = #{frequency},</if>
|
||||
<if test="internalTemp != null">internal_temp = #{internalTemp},</if>
|
||||
<if test="uIgbtTemp != null">u_igbt_temp = #{uIgbtTemp},</if>
|
||||
<if test="vIgbtTemp != null">v_igbt_temp = #{vIgbtTemp},</if>
|
||||
<if test="wIgbtTemp != null">w_igbt_temp = #{wIgbtTemp},</if>
|
||||
<if test="gridStatus != null">grid_status = #{gridStatus},</if>
|
||||
<if test="availablePower != null">available_power = #{availablePower},</if>
|
||||
<if test="totalLoadRatio != null">total_load_ratio = #{totalLoadRatio},</if>
|
||||
<if test="acLeakageCurrent != null">ac_leakage_current = #{acLeakageCurrent},</if>
|
||||
<if test="insulationResistance != null">insulation_resistance = #{insulationResistance},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
@ -87,7 +87,7 @@
|
||||
<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>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</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>
|
||||
@ -278,4 +278,81 @@
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<select id="getPcsDataBySiteId" parameterType="String" 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="String" 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="String" resultType="com.xzzn.ems.domain.vo.SiteMonitorRunningHeadInfoVo">
|
||||
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="String" 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>
|
@ -18,10 +18,11 @@
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="siteId" column="site_id" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsSiteSettingVo">
|
||||
select id, site_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time from ems_site_setting
|
||||
select id, site_name, site_address, running_time, latitude, longitude, install_capacity, install_power, remark, create_by, update_by, create_time, update_time, site_id from ems_site_setting
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsSiteSettingList" parameterType="EmsSiteSetting" resultMap="EmsSiteSettingResult">
|
||||
@ -34,6 +35,7 @@
|
||||
<if test="longitude != null "> and longitude = #{longitude}</if>
|
||||
<if test="installCapacity != null "> and install_capacity = #{installCapacity}</if>
|
||||
<if test="installPower != null "> and install_power = #{installPower}</if>
|
||||
<if test="siteId != null and siteId != ''"> and site_id = #{siteId}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -57,6 +59,7 @@
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="siteId != null and siteId != ''">site_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteName != null and siteName != ''">#{siteName},</if>
|
||||
@ -71,6 +74,7 @@
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="siteId != null and siteId != ''">#{siteId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -89,6 +93,7 @@
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="siteId != null and siteId != ''">site_id = #{siteId},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
@ -105,9 +110,14 @@
|
||||
</delete>
|
||||
|
||||
<select id="getSiteTotalInfo" resultType="com.xzzn.ems.domain.vo.SiteTotalInfoVo">
|
||||
select count(DISTINCT s.id) as siteNum,
|
||||
select count(DISTINCT s.site_id) as siteNum,
|
||||
SUM(s.install_capacity) as installCapacity,
|
||||
SUM(s.install_power) as installPower
|
||||
from ems_site_setting s
|
||||
</select>
|
||||
|
||||
<select id="selectEmsSiteSettingBySiteId" parameterType="String" resultMap="EmsSiteSettingResult">
|
||||
<include refid="selectEmsSiteSettingVo"/>
|
||||
where site_id = #{siteId}
|
||||
</select>
|
||||
</mapper>
|
Reference in New Issue
Block a user