277 lines
21 KiB
XML
277 lines
21 KiB
XML
<?xml version="1.0" encoding="UTF-8" ?>
|
|
<!DOCTYPE mapper
|
|
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
<mapper namespace="com.xzzn.ems.mapper.EmsBatteryStackMapper">
|
|
|
|
<resultMap type="EmsBatteryStack" id="EmsBatteryStackResult">
|
|
<result property="id" column="id" />
|
|
<result property="workStatus" column="work_status" />
|
|
<result property="pcsCommunicationStatus" column="pcs_communication_status" />
|
|
<result property="emsCommunicationStatus" column="ems_communication_status" />
|
|
<result property="operationStatus" column="operation_status" />
|
|
<result property="stackVoltage" column="stack_voltage" />
|
|
<result property="stackCurrent" column="stack_current" />
|
|
<result property="stackSoc" column="stack_soc" />
|
|
<result property="stackSoh" column="stack_soh" />
|
|
<result property="maxCellVoltage" column="max_cell_voltage" />
|
|
<result property="maxVoltageGroupId" column="max_voltage_group_id" />
|
|
<result property="maxVoltageCellId" column="max_voltage_cell_id" />
|
|
<result property="minCellVoltage" column="min_cell_voltage" />
|
|
<result property="minVoltageGroupId" column="min_voltage_group_id" />
|
|
<result property="minVoltageCellId" column="min_voltage_cell_id" />
|
|
<result property="maxCellTemp" column="max_cell_temp" />
|
|
<result property="maxTempGroupId" column="max_temp_group_id" />
|
|
<result property="maxTempCellId" column="max_temp_cell_id" />
|
|
<result property="minCellTemp" column="min_cell_temp" />
|
|
<result property="minTempGroupId" column="min_temp_group_id" />
|
|
<result property="minTempCellId" column="min_temp_cell_id" />
|
|
<result property="totalChargeCapacity" column="total_charge_capacity" />
|
|
<result property="totalDischargeCapacity" column="total_discharge_capacity" />
|
|
<result property="sessionChargeCapacity" column="session_charge_capacity" />
|
|
<result property="sessionDischargeCapacity" column="session_discharge_capacity" />
|
|
<result property="availableChargeCapacity" column="available_charge_capacity" />
|
|
<result property="availableDischargeCapacity" column="available_discharge_capacity" />
|
|
<result property="remainingDischargeTime" column="remaining_discharge_time" />
|
|
<result property="remainingChargeTime" column="remaining_charge_time" />
|
|
<result property="maxDischargePower" column="max_discharge_power" />
|
|
<result property="maxChargePower" column="max_charge_power" />
|
|
<result property="maxDischargeCurrent" column="max_discharge_current" />
|
|
<result property="maxChargeCurrent" column="max_charge_current" />
|
|
<result property="dailyDischargeCycles" column="daily_discharge_cycles" />
|
|
<result property="dailyChargeCycles" column="daily_charge_cycles" />
|
|
<result property="dailyDischargeCapacity" column="daily_discharge_capacity" />
|
|
<result property="dailyChargeCapacity" column="daily_charge_capacity" />
|
|
<result property="operatingTemp" column="operating_temp" />
|
|
<result property="bmsStatus" column="bms_status" />
|
|
<result property="bmsChargeStatus" column="bms_charge_status" />
|
|
<result property="stackInsulationResistance" column="stack_insulation_resistance" />
|
|
<result property="siteId" column="site_id" />
|
|
<result property="deviceId" column="device_id" />
|
|
<result property="createTime" column="create_time" />
|
|
<result property="createBy" column="create_by" />
|
|
<result property="updateTime" column="update_time" />
|
|
<result property="updateBy" column="update_by" />
|
|
</resultMap>
|
|
|
|
<sql id="selectEmsBatteryStackVo">
|
|
select id, work_status, pcs_communication_status, ems_communication_status, operation_status, stack_voltage, stack_current, stack_soc, stack_soh, max_cell_voltage, max_voltage_group_id, max_voltage_cell_id, min_cell_voltage, min_voltage_group_id, min_voltage_cell_id, max_cell_temp, max_temp_group_id, max_temp_cell_id, min_cell_temp, min_temp_group_id, min_temp_cell_id, total_charge_capacity, total_discharge_capacity, session_charge_capacity, session_discharge_capacity, available_charge_capacity, available_discharge_capacity, remaining_discharge_time, remaining_charge_time, max_discharge_power, max_charge_power, max_discharge_current, max_charge_current, daily_discharge_cycles, daily_charge_cycles, daily_discharge_capacity, daily_charge_capacity, operating_temp, bms_status, bms_charge_status, stack_insulation_resistance, site_id, device_id, create_time, create_by, update_time, update_by from ems_battery_stack
|
|
</sql>
|
|
|
|
<select id="selectEmsBatteryStackList" parameterType="EmsBatteryStack" resultMap="EmsBatteryStackResult">
|
|
<include refid="selectEmsBatteryStackVo"/>
|
|
<where>
|
|
<if test="workStatus != null and workStatus != ''"> and work_status = #{workStatus}</if>
|
|
<if test="pcsCommunicationStatus != null and pcsCommunicationStatus != ''"> and pcs_communication_status = #{pcsCommunicationStatus}</if>
|
|
<if test="emsCommunicationStatus != null and emsCommunicationStatus != ''"> and ems_communication_status = #{emsCommunicationStatus}</if>
|
|
<if test="operationStatus != null and operationStatus != ''"> and operation_status = #{operationStatus}</if>
|
|
<if test="stackVoltage != null "> and stack_voltage = #{stackVoltage}</if>
|
|
<if test="stackCurrent != null "> and stack_current = #{stackCurrent}</if>
|
|
<if test="stackSoc != null "> and stack_soc = #{stackSoc}</if>
|
|
<if test="stackSoh != null "> and stack_soh = #{stackSoh}</if>
|
|
<if test="maxCellVoltage != null "> and max_cell_voltage = #{maxCellVoltage}</if>
|
|
<if test="maxVoltageGroupId != null "> and max_voltage_group_id = #{maxVoltageGroupId}</if>
|
|
<if test="maxVoltageCellId != null "> and max_voltage_cell_id = #{maxVoltageCellId}</if>
|
|
<if test="minCellVoltage != null "> and min_cell_voltage = #{minCellVoltage}</if>
|
|
<if test="minVoltageGroupId != null "> and min_voltage_group_id = #{minVoltageGroupId}</if>
|
|
<if test="minVoltageCellId != null "> and min_voltage_cell_id = #{minVoltageCellId}</if>
|
|
<if test="maxCellTemp != null "> and max_cell_temp = #{maxCellTemp}</if>
|
|
<if test="maxTempGroupId != null "> and max_temp_group_id = #{maxTempGroupId}</if>
|
|
<if test="maxTempCellId != null "> and max_temp_cell_id = #{maxTempCellId}</if>
|
|
<if test="minCellTemp != null "> and min_cell_temp = #{minCellTemp}</if>
|
|
<if test="minTempGroupId != null "> and min_temp_group_id = #{minTempGroupId}</if>
|
|
<if test="minTempCellId != null "> and min_temp_cell_id = #{minTempCellId}</if>
|
|
<if test="totalChargeCapacity != null "> and total_charge_capacity = #{totalChargeCapacity}</if>
|
|
<if test="totalDischargeCapacity != null "> and total_discharge_capacity = #{totalDischargeCapacity}</if>
|
|
<if test="sessionChargeCapacity != null "> and session_charge_capacity = #{sessionChargeCapacity}</if>
|
|
<if test="sessionDischargeCapacity != null "> and session_discharge_capacity = #{sessionDischargeCapacity}</if>
|
|
<if test="availableChargeCapacity != null "> and available_charge_capacity = #{availableChargeCapacity}</if>
|
|
<if test="availableDischargeCapacity != null "> and available_discharge_capacity = #{availableDischargeCapacity}</if>
|
|
<if test="remainingDischargeTime != null "> and remaining_discharge_time = #{remainingDischargeTime}</if>
|
|
<if test="remainingChargeTime != null "> and remaining_charge_time = #{remainingChargeTime}</if>
|
|
<if test="maxDischargePower != null "> and max_discharge_power = #{maxDischargePower}</if>
|
|
<if test="maxChargePower != null "> and max_charge_power = #{maxChargePower}</if>
|
|
<if test="maxDischargeCurrent != null "> and max_discharge_current = #{maxDischargeCurrent}</if>
|
|
<if test="maxChargeCurrent != null "> and max_charge_current = #{maxChargeCurrent}</if>
|
|
<if test="dailyDischargeCycles != null "> and daily_discharge_cycles = #{dailyDischargeCycles}</if>
|
|
<if test="dailyChargeCycles != null "> and daily_charge_cycles = #{dailyChargeCycles}</if>
|
|
<if test="dailyDischargeCapacity != null "> and daily_discharge_capacity = #{dailyDischargeCapacity}</if>
|
|
<if test="dailyChargeCapacity != null "> and daily_charge_capacity = #{dailyChargeCapacity}</if>
|
|
<if test="operatingTemp != null "> and operating_temp = #{operatingTemp}</if>
|
|
<if test="bmsStatus != null and bmsStatus != ''"> and bms_status = #{bmsStatus}</if>
|
|
<if test="bmsChargeStatus != null and bmsChargeStatus != ''"> and bms_charge_status = #{bmsChargeStatus}</if>
|
|
<if test="stackInsulationResistance != null "> and stack_insulation_resistance = #{stackInsulationResistance}</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>
|
|
|
|
<select id="selectEmsBatteryStackById" parameterType="Long" resultMap="EmsBatteryStackResult">
|
|
<include refid="selectEmsBatteryStackVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertEmsBatteryStack" parameterType="EmsBatteryStack" useGeneratedKeys="true" keyProperty="id">
|
|
insert into ems_battery_stack
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="workStatus != null">work_status,</if>
|
|
<if test="pcsCommunicationStatus != null">pcs_communication_status,</if>
|
|
<if test="emsCommunicationStatus != null">ems_communication_status,</if>
|
|
<if test="operationStatus != null">operation_status,</if>
|
|
<if test="stackVoltage != null">stack_voltage,</if>
|
|
<if test="stackCurrent != null">stack_current,</if>
|
|
<if test="stackSoc != null">stack_soc,</if>
|
|
<if test="stackSoh != null">stack_soh,</if>
|
|
<if test="maxCellVoltage != null">max_cell_voltage,</if>
|
|
<if test="maxVoltageGroupId != null">max_voltage_group_id,</if>
|
|
<if test="maxVoltageCellId != null">max_voltage_cell_id,</if>
|
|
<if test="minCellVoltage != null">min_cell_voltage,</if>
|
|
<if test="minVoltageGroupId != null">min_voltage_group_id,</if>
|
|
<if test="minVoltageCellId != null">min_voltage_cell_id,</if>
|
|
<if test="maxCellTemp != null">max_cell_temp,</if>
|
|
<if test="maxTempGroupId != null">max_temp_group_id,</if>
|
|
<if test="maxTempCellId != null">max_temp_cell_id,</if>
|
|
<if test="minCellTemp != null">min_cell_temp,</if>
|
|
<if test="minTempGroupId != null">min_temp_group_id,</if>
|
|
<if test="minTempCellId != null">min_temp_cell_id,</if>
|
|
<if test="totalChargeCapacity != null">total_charge_capacity,</if>
|
|
<if test="totalDischargeCapacity != null">total_discharge_capacity,</if>
|
|
<if test="sessionChargeCapacity != null">session_charge_capacity,</if>
|
|
<if test="sessionDischargeCapacity != null">session_discharge_capacity,</if>
|
|
<if test="availableChargeCapacity != null">available_charge_capacity,</if>
|
|
<if test="availableDischargeCapacity != null">available_discharge_capacity,</if>
|
|
<if test="remainingDischargeTime != null">remaining_discharge_time,</if>
|
|
<if test="remainingChargeTime != null">remaining_charge_time,</if>
|
|
<if test="maxDischargePower != null">max_discharge_power,</if>
|
|
<if test="maxChargePower != null">max_charge_power,</if>
|
|
<if test="maxDischargeCurrent != null">max_discharge_current,</if>
|
|
<if test="maxChargeCurrent != null">max_charge_current,</if>
|
|
<if test="dailyDischargeCycles != null">daily_discharge_cycles,</if>
|
|
<if test="dailyChargeCycles != null">daily_charge_cycles,</if>
|
|
<if test="dailyDischargeCapacity != null">daily_discharge_capacity,</if>
|
|
<if test="dailyChargeCapacity != null">daily_charge_capacity,</if>
|
|
<if test="operatingTemp != null">operating_temp,</if>
|
|
<if test="bmsStatus != null">bms_status,</if>
|
|
<if test="bmsChargeStatus != null">bms_charge_status,</if>
|
|
<if test="stackInsulationResistance != null">stack_insulation_resistance,</if>
|
|
<if test="siteId != null and siteId != ''">site_id,</if>
|
|
<if test="deviceId != null and deviceId != ''">device_id,</if>
|
|
<if test="createTime != null">create_time,</if>
|
|
<if test="createBy != null">create_by,</if>
|
|
<if test="updateTime != null">update_time,</if>
|
|
<if test="updateBy != null">update_by,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="workStatus != null">#{workStatus},</if>
|
|
<if test="pcsCommunicationStatus != null">#{pcsCommunicationStatus},</if>
|
|
<if test="emsCommunicationStatus != null">#{emsCommunicationStatus},</if>
|
|
<if test="operationStatus != null">#{operationStatus},</if>
|
|
<if test="stackVoltage != null">#{stackVoltage},</if>
|
|
<if test="stackCurrent != null">#{stackCurrent},</if>
|
|
<if test="stackSoc != null">#{stackSoc},</if>
|
|
<if test="stackSoh != null">#{stackSoh},</if>
|
|
<if test="maxCellVoltage != null">#{maxCellVoltage},</if>
|
|
<if test="maxVoltageGroupId != null">#{maxVoltageGroupId},</if>
|
|
<if test="maxVoltageCellId != null">#{maxVoltageCellId},</if>
|
|
<if test="minCellVoltage != null">#{minCellVoltage},</if>
|
|
<if test="minVoltageGroupId != null">#{minVoltageGroupId},</if>
|
|
<if test="minVoltageCellId != null">#{minVoltageCellId},</if>
|
|
<if test="maxCellTemp != null">#{maxCellTemp},</if>
|
|
<if test="maxTempGroupId != null">#{maxTempGroupId},</if>
|
|
<if test="maxTempCellId != null">#{maxTempCellId},</if>
|
|
<if test="minCellTemp != null">#{minCellTemp},</if>
|
|
<if test="minTempGroupId != null">#{minTempGroupId},</if>
|
|
<if test="minTempCellId != null">#{minTempCellId},</if>
|
|
<if test="totalChargeCapacity != null">#{totalChargeCapacity},</if>
|
|
<if test="totalDischargeCapacity != null">#{totalDischargeCapacity},</if>
|
|
<if test="sessionChargeCapacity != null">#{sessionChargeCapacity},</if>
|
|
<if test="sessionDischargeCapacity != null">#{sessionDischargeCapacity},</if>
|
|
<if test="availableChargeCapacity != null">#{availableChargeCapacity},</if>
|
|
<if test="availableDischargeCapacity != null">#{availableDischargeCapacity},</if>
|
|
<if test="remainingDischargeTime != null">#{remainingDischargeTime},</if>
|
|
<if test="remainingChargeTime != null">#{remainingChargeTime},</if>
|
|
<if test="maxDischargePower != null">#{maxDischargePower},</if>
|
|
<if test="maxChargePower != null">#{maxChargePower},</if>
|
|
<if test="maxDischargeCurrent != null">#{maxDischargeCurrent},</if>
|
|
<if test="maxChargeCurrent != null">#{maxChargeCurrent},</if>
|
|
<if test="dailyDischargeCycles != null">#{dailyDischargeCycles},</if>
|
|
<if test="dailyChargeCycles != null">#{dailyChargeCycles},</if>
|
|
<if test="dailyDischargeCapacity != null">#{dailyDischargeCapacity},</if>
|
|
<if test="dailyChargeCapacity != null">#{dailyChargeCapacity},</if>
|
|
<if test="operatingTemp != null">#{operatingTemp},</if>
|
|
<if test="bmsStatus != null">#{bmsStatus},</if>
|
|
<if test="bmsChargeStatus != null">#{bmsChargeStatus},</if>
|
|
<if test="stackInsulationResistance != null">#{stackInsulationResistance},</if>
|
|
<if test="siteId != null and siteId != ''">#{siteId},</if>
|
|
<if test="deviceId != null and deviceId != ''">#{deviceId},</if>
|
|
<if test="createTime != null">#{createTime},</if>
|
|
<if test="createBy != null">#{createBy},</if>
|
|
<if test="updateTime != null">#{updateTime},</if>
|
|
<if test="updateBy != null">#{updateBy},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateEmsBatteryStack" parameterType="EmsBatteryStack">
|
|
update ems_battery_stack
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="workStatus != null">work_status = #{workStatus},</if>
|
|
<if test="pcsCommunicationStatus != null">pcs_communication_status = #{pcsCommunicationStatus},</if>
|
|
<if test="emsCommunicationStatus != null">ems_communication_status = #{emsCommunicationStatus},</if>
|
|
<if test="operationStatus != null">operation_status = #{operationStatus},</if>
|
|
<if test="stackVoltage != null">stack_voltage = #{stackVoltage},</if>
|
|
<if test="stackCurrent != null">stack_current = #{stackCurrent},</if>
|
|
<if test="stackSoc != null">stack_soc = #{stackSoc},</if>
|
|
<if test="stackSoh != null">stack_soh = #{stackSoh},</if>
|
|
<if test="maxCellVoltage != null">max_cell_voltage = #{maxCellVoltage},</if>
|
|
<if test="maxVoltageGroupId != null">max_voltage_group_id = #{maxVoltageGroupId},</if>
|
|
<if test="maxVoltageCellId != null">max_voltage_cell_id = #{maxVoltageCellId},</if>
|
|
<if test="minCellVoltage != null">min_cell_voltage = #{minCellVoltage},</if>
|
|
<if test="minVoltageGroupId != null">min_voltage_group_id = #{minVoltageGroupId},</if>
|
|
<if test="minVoltageCellId != null">min_voltage_cell_id = #{minVoltageCellId},</if>
|
|
<if test="maxCellTemp != null">max_cell_temp = #{maxCellTemp},</if>
|
|
<if test="maxTempGroupId != null">max_temp_group_id = #{maxTempGroupId},</if>
|
|
<if test="maxTempCellId != null">max_temp_cell_id = #{maxTempCellId},</if>
|
|
<if test="minCellTemp != null">min_cell_temp = #{minCellTemp},</if>
|
|
<if test="minTempGroupId != null">min_temp_group_id = #{minTempGroupId},</if>
|
|
<if test="minTempCellId != null">min_temp_cell_id = #{minTempCellId},</if>
|
|
<if test="totalChargeCapacity != null">total_charge_capacity = #{totalChargeCapacity},</if>
|
|
<if test="totalDischargeCapacity != null">total_discharge_capacity = #{totalDischargeCapacity},</if>
|
|
<if test="sessionChargeCapacity != null">session_charge_capacity = #{sessionChargeCapacity},</if>
|
|
<if test="sessionDischargeCapacity != null">session_discharge_capacity = #{sessionDischargeCapacity},</if>
|
|
<if test="availableChargeCapacity != null">available_charge_capacity = #{availableChargeCapacity},</if>
|
|
<if test="availableDischargeCapacity != null">available_discharge_capacity = #{availableDischargeCapacity},</if>
|
|
<if test="remainingDischargeTime != null">remaining_discharge_time = #{remainingDischargeTime},</if>
|
|
<if test="remainingChargeTime != null">remaining_charge_time = #{remainingChargeTime},</if>
|
|
<if test="maxDischargePower != null">max_discharge_power = #{maxDischargePower},</if>
|
|
<if test="maxChargePower != null">max_charge_power = #{maxChargePower},</if>
|
|
<if test="maxDischargeCurrent != null">max_discharge_current = #{maxDischargeCurrent},</if>
|
|
<if test="maxChargeCurrent != null">max_charge_current = #{maxChargeCurrent},</if>
|
|
<if test="dailyDischargeCycles != null">daily_discharge_cycles = #{dailyDischargeCycles},</if>
|
|
<if test="dailyChargeCycles != null">daily_charge_cycles = #{dailyChargeCycles},</if>
|
|
<if test="dailyDischargeCapacity != null">daily_discharge_capacity = #{dailyDischargeCapacity},</if>
|
|
<if test="dailyChargeCapacity != null">daily_charge_capacity = #{dailyChargeCapacity},</if>
|
|
<if test="operatingTemp != null">operating_temp = #{operatingTemp},</if>
|
|
<if test="bmsStatus != null">bms_status = #{bmsStatus},</if>
|
|
<if test="bmsChargeStatus != null">bms_charge_status = #{bmsChargeStatus},</if>
|
|
<if test="stackInsulationResistance != null">stack_insulation_resistance = #{stackInsulationResistance},</if>
|
|
<if test="siteId != null and siteId != ''">site_id = #{siteId},</if>
|
|
<if test="deviceId != null and deviceId != ''">device_id = #{deviceId},</if>
|
|
<if test="createTime != null">create_time = #{createTime},</if>
|
|
<if test="createBy != null">create_by = #{createBy},</if>
|
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteEmsBatteryStackById" parameterType="Long">
|
|
delete from ems_battery_stack where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteEmsBatteryStackByIds" parameterType="String">
|
|
delete from ems_battery_stack where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper> |