<?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.ruoyi.sy.mapper.ArdTankLockStateMapper">
|
|
<resultMap type="ArdTankLockState" id="ArdTankLockStateResult">
|
<result property="id" column="id" />
|
<result property="lockId" column="lock_id" />
|
<result property="lockNum" column="lock_num" />
|
<result property="lockState" column="lock_state" />
|
<result property="lockPositionState" column="lock_position_state" />
|
<result property="lockShellState" column="lock_shell_state" />
|
<result property="restartState" column="restart_state" />
|
<result property="batterVoltage" column="batter_voltage" />
|
<result property="powerVoltage" column="power_voltage" />
|
<result property="uploadTime" column="upload_time" />
|
<result property="uniqueMark" column="unique_mark" />
|
</resultMap>
|
|
<sql id="selectArdTankLockStateVo">
|
select id, lock_id, lock_num, lock_state, lock_position_state, lock_shell_state, restart_state, batter_voltage, power_voltage, upload_time, unique_mark from ard_tank_lock_state
|
</sql>
|
|
<select id="selectArdTankLockStateList" parameterType="ArdTankLockState" resultMap="ArdTankLockStateResult">
|
<include refid="selectArdTankLockStateVo"/>
|
<where>
|
<if test="lockId != null and lockId != ''"> and lock_id = #{lockId}</if>
|
<if test="lockNum != null and lockNum != ''"> and lock_num = #{lockNum}</if>
|
<if test="lockState != null and lockState != ''"> and lock_state = #{lockState}</if>
|
<if test="lockPositionState != null and lockPositionState != ''"> and lock_position_state = #{lockPositionState}</if>
|
<if test="lockShellState != null and lockShellState != ''"> and lock_shell_state = #{lockShellState}</if>
|
<if test="restartState != null and restartState != ''"> and restart_state = #{restartState}</if>
|
<if test="batterVoltage != null and batterVoltage != ''"> and batter_voltage = #{batterVoltage}</if>
|
<if test="powerVoltage != null and powerVoltage != ''"> and power_voltage = #{powerVoltage}</if>
|
<if test="uploadTime != null and uploadTime != ''"> and upload_time = #{uploadTime}</if>
|
<if test="uniqueMark != null and uniqueMark != ''"> and unique_mark = #{uniqueMark}</if>
|
</where>
|
</select>
|
|
<select id="selectArdTankLockStateById" parameterType="String" resultMap="ArdTankLockStateResult">
|
<include refid="selectArdTankLockStateVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertArdTankLockState" parameterType="ArdTankLockState">
|
insert into ard_tank_lock_state
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="lockId != null">lock_id,</if>
|
<if test="lockNum != null">lock_num,</if>
|
<if test="lockState != null">lock_state,</if>
|
<if test="lockPositionState != null">lock_position_state,</if>
|
<if test="lockShellState != null">lock_shell_state,</if>
|
<if test="restartState != null">restart_state,</if>
|
<if test="batterVoltage != null">batter_voltage,</if>
|
<if test="powerVoltage != null">power_voltage,</if>
|
<if test="uploadTime != null">upload_time,</if>
|
<if test="uniqueMark != null">unique_mark,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="lockId != null">#{lockId},</if>
|
<if test="lockNum != null">#{lockNum},</if>
|
<if test="lockState != null">#{lockState},</if>
|
<if test="lockPositionState != null">#{lockPositionState},</if>
|
<if test="lockShellState != null">#{lockShellState},</if>
|
<if test="restartState != null">#{restartState},</if>
|
<if test="batterVoltage != null">#{batterVoltage},</if>
|
<if test="powerVoltage != null">#{powerVoltage},</if>
|
<if test="uploadTime != null">#{uploadTime},</if>
|
<if test="uniqueMark != null">#{uniqueMark},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdTankLockState" parameterType="ArdTankLockState">
|
update ard_tank_lock_state
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="lockId != null">lock_id = #{lockId},</if>
|
<if test="lockNum != null">lock_num = #{lockNum},</if>
|
<if test="lockState != null">lock_state = #{lockState},</if>
|
<if test="lockPositionState != null">lock_position_state = #{lockPositionState},</if>
|
<if test="lockShellState != null">lock_shell_state = #{lockShellState},</if>
|
<if test="restartState != null">restart_state = #{restartState},</if>
|
<if test="batterVoltage != null">batter_voltage = #{batterVoltage},</if>
|
<if test="powerVoltage != null">power_voltage = #{powerVoltage},</if>
|
<if test="uploadTime != null">upload_time = #{uploadTime},</if>
|
<if test="uniqueMark != null">unique_mark = #{uniqueMark},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteArdTankLockStateById" parameterType="String">
|
delete from ard_tank_lock_state where id = #{id}
|
</delete>
|
|
<delete id="deleteArdTankLockStateByIds" parameterType="String">
|
delete from ard_tank_lock_state where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<insert id="insertOrUpdateArdTankLockState" parameterType="ArdTankLockState" >
|
insert into ard_tank_lock_state (id, lock_id, lock_num, lock_state, lock_position_state, lock_shell_state,
|
restart_state, batter_voltage, power_voltage, upload_time, unique_mark)
|
values (#{id,jdbcType=VARCHAR},#{lockId,jdbcType=VARCHAR},#{lockNum,jdbcType=VARCHAR},#{lockState,jdbcType=VARCHAR},
|
#{lockPositionState,jdbcType=VARCHAR},#{lockShellState,jdbcType=VARCHAR},#{restartState,jdbcType=VARCHAR},
|
#{batterVoltage,jdbcType=VARCHAR},#{powerVoltage,jdbcType=VARCHAR},#{uploadTime,jdbcType=VARCHAR},
|
#{uniqueMark,jdbcType=VARCHAR})
|
on conflict(unique_mark) do update set upload_time=#{uploadTime,jdbcType=VARCHAR}
|
</insert>
|
</mapper>
|