集成modbus连接本地设备读取数据代码-配置文件方式读取;
PCS开关机功能通过modbus连接设备发送控制命令;
This commit is contained in:
@ -23,11 +23,12 @@
|
||||
<result property="deviceId" column="device_id" />
|
||||
<result property="clusterDeviceId" column="cluster_device_id" />
|
||||
<result property="interResistance" column="inter_resistance" />
|
||||
<result property="current" column="current" />
|
||||
<result property="dayTime" column="day_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectEmsBatteryDataDayVo">
|
||||
select id, battery_pack, battery_cluster, battery_cell_id, voltage, temperature, soc, soh, data_timestamp, create_by, create_time, update_by, update_time, remark, site_id, device_id, cluster_device_id, inter_resistance, day_time from ems_battery_data_day
|
||||
select id, battery_pack, battery_cluster, battery_cell_id, voltage, temperature, soc, soh, data_timestamp, create_by, create_time, update_by, update_time, remark, site_id, device_id, cluster_device_id, inter_resistance, current, day_time from ems_battery_data_day
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsBatteryDataDayList" parameterType="EmsBatteryDataDay" resultMap="EmsBatteryDataDayResult">
|
||||
@ -45,6 +46,7 @@
|
||||
<if test="deviceId != null and deviceId != ''"> and device_id = #{deviceId}</if>
|
||||
<if test="clusterDeviceId != null and clusterDeviceId != ''"> and cluster_device_id = #{clusterDeviceId}</if>
|
||||
<if test="interResistance != null "> and inter_resistance = #{interResistance}</if>
|
||||
<if test="current != null "> and current = #{current}</if>
|
||||
<if test="dayTime != null "> and day_time = #{dayTime}</if>
|
||||
</where>
|
||||
</select>
|
||||
@ -74,6 +76,7 @@
|
||||
<if test="deviceId != null">device_id,</if>
|
||||
<if test="clusterDeviceId != null">cluster_device_id,</if>
|
||||
<if test="interResistance != null">inter_resistance,</if>
|
||||
<if test="current != null">current,</if>
|
||||
<if test="dayTime != null">day_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
@ -118,6 +121,7 @@
|
||||
<if test="deviceId != null">device_id = #{deviceId},</if>
|
||||
<if test="clusterDeviceId != null">cluster_device_id = #{clusterDeviceId},</if>
|
||||
<if test="interResistance != null">inter_resistance = #{interResistance},</if>
|
||||
<if test="current != null">current = #{current},</if>
|
||||
<if test="dayTime != null">day_time = #{dayTime},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
@ -164,6 +168,7 @@
|
||||
device_id,
|
||||
cluster_device_id,
|
||||
inter_resistance,
|
||||
current,
|
||||
day_time
|
||||
) VALUES
|
||||
<foreach collection="list" item="item" separator=",">
|
||||
@ -184,6 +189,7 @@
|
||||
#{item.deviceId},
|
||||
#{item.clusterDeviceId},
|
||||
#{item.interResistance},
|
||||
#{item.current},
|
||||
#{item.dayTime}
|
||||
)
|
||||
</foreach>
|
||||
@ -195,6 +201,7 @@
|
||||
soc = IF(VALUES(temperature) > temperature, VALUES(soc), soc),
|
||||
soh = IF(VALUES(temperature) > temperature, VALUES(soh), soh),
|
||||
inter_resistance = IF(VALUES(temperature) > temperature, VALUES(inter_resistance), inter_resistance),
|
||||
current = IF(VALUES(temperature) > temperature, VALUES(current), current),
|
||||
update_by = IF(VALUES(temperature) > temperature, VALUES(update_by), update_by),
|
||||
temperature = IF(VALUES(temperature) > temperature, VALUES(temperature), temperature)
|
||||
</insert>
|
||||
|
||||
@ -64,10 +64,22 @@
|
||||
<result property="module2Temp" column="module2_temp" />
|
||||
<result property="module3Temp" column="module3_temp" />
|
||||
<result property="module4Temp" column="module4_temp" />
|
||||
<result property="cluster1ActivePower" column="cluster1_active_power" />
|
||||
<result property="cluster2ActivePower" column="cluster2_active_power" />
|
||||
<result property="cluster3ActivePower" column="cluster3_active_power" />
|
||||
<result property="cluster4ActivePower" column="cluster4_active_power" />
|
||||
</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, 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, u_temperature, v_temperature, w_temperature, module1_temp, module2_temp, module3_temp, module4_temp 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, sys_u_current, sys_v_current, sys_w_current, dw_frequency, u_temperature, v_temperature, w_temperature,
|
||||
module1_temp, module2_temp, module3_temp, module4_temp, cluster1_active_power, cluster2_active_power, cluster3_active_power, cluster4_active_power from ems_pcs_data
|
||||
</sql>
|
||||
|
||||
<select id="selectEmsPcsDataList" parameterType="EmsPcsData" resultMap="EmsPcsDataResult">
|
||||
@ -126,6 +138,10 @@
|
||||
<if test="module2Temp != null "> and module2_temp = #{module2Temp}</if>
|
||||
<if test="module3Temp != null "> and module3_temp = #{module3Temp}</if>
|
||||
<if test="module4Temp != null "> and module4_temp = #{module4Temp}</if>
|
||||
<if test="cluster1ActivePower != null "> and cluster1_active_power = #{cluster1ActivePower}</if>
|
||||
<if test="cluster2ActivePower != null "> and cluster2_active_power = #{cluster2ActivePower}</if>
|
||||
<if test="cluster3ActivePower != null "> and cluster3_active_power = #{cluster3ActivePower}</if>
|
||||
<if test="cluster4ActivePower != null "> and cluster4_active_power = #{cluster4ActivePower}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
@ -195,6 +211,10 @@
|
||||
<if test="module2Temp != null">module2_temp,</if>
|
||||
<if test="module3Temp != null">module3_temp,</if>
|
||||
<if test="module4Temp != null">module4_temp,</if>
|
||||
<if test="cluster1ActivePower != null">cluster1_active_power,</if>
|
||||
<if test="cluster2ActivePower != null">cluster2_active_power,</if>
|
||||
<if test="cluster3ActivePower != null">cluster3_active_power,</if>
|
||||
<if test="cluster4ActivePower != null">cluster4_active_power,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dataUpdateTime != null">#{dataUpdateTime},</if>
|
||||
@ -255,6 +275,10 @@
|
||||
<if test="module2Temp != null">#{module2Temp},</if>
|
||||
<if test="module3Temp != null">#{module3Temp},</if>
|
||||
<if test="module4Temp != null">#{module4Temp},</if>
|
||||
<if test="cluster1ActivePower != null">#{cluster1ActivePower},</if>
|
||||
<if test="cluster2ActivePower != null">#{cluster2ActivePower},</if>
|
||||
<if test="cluster3ActivePower != null">#{cluster3ActivePower},</if>
|
||||
<if test="cluster4ActivePower != null">#{cluster4ActivePower},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
@ -319,6 +343,10 @@
|
||||
<if test="module2Temp != null">module2_temp = #{module2Temp},</if>
|
||||
<if test="module3Temp != null">module3_temp = #{module3Temp},</if>
|
||||
<if test="module4Temp != null">module4_temp = #{module4Temp},</if>
|
||||
<if test="cluster1ActivePower != null">cluster1_active_power = #{cluster1ActivePower},</if>
|
||||
<if test="cluster2ActivePower != null">cluster2_active_power = #{cluster2ActivePower},</if>
|
||||
<if test="cluster3ActivePower != null">cluster3_active_power = #{cluster3ActivePower},</if>
|
||||
<if test="cluster4ActivePower != null">cluster4_active_power = #{cluster4ActivePower},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
@ -541,12 +541,15 @@
|
||||
and device_id = #{deviceId}
|
||||
and device_category = #{deviceCategory}
|
||||
</select>
|
||||
<select id="selectDeviceStatusPoint" resultType="EmsPointMatch" parameterType="com.xzzn.ems.domain.vo.DeviceUpdateRequest">
|
||||
<select id="selectDeviceStatusPoint" parameterType="com.xzzn.ems.domain.vo.DeviceUpdateRequest" resultMap="EmsPointMatchResult" >
|
||||
<include refid="selectEmsPointMatchVo"/>
|
||||
where site_id = #{request.siteId}
|
||||
and device_id = #{request.deviceId}
|
||||
and device_category = #{request.deviceCategory}
|
||||
and match_field = 'device_status'
|
||||
and match_field in
|
||||
<foreach collection="list" item="matchField" open="(" separator="," close=")">
|
||||
#{matchField}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user