<?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.ArdTankLockMapper">
|
|
<resultMap type="ArdTankLock" id="ArdTankLockResult">
|
<result property="id" column="id" />
|
<result property="lockNum" column="lock_num" />
|
<result property="lockName" column="lock_name" />
|
<result property="imgPositionTop" column="img_position_top" />
|
<result property="imgPositionLeft" column="img_position_left" />
|
<result property="carId" column="car_id" />
|
<result property="enable" column="enable" />
|
<result property="restartState" column="restart_state" />
|
<result property="onlineTime" column="online_time" />
|
</resultMap>
|
|
<sql id="selectArdTankLockVo">
|
select id, lock_num, lock_name, img_position_top, img_position_left, car_id, enable, restart_state, online_time from ard_tank_lock
|
</sql>
|
|
<select id="selectArdTankLockList" parameterType="ArdTankLock" resultMap="ArdTankLockResult">
|
<include refid="selectArdTankLockVo"/>
|
<where>
|
<if test="lockNum != null and lockNum != ''"> and lock_num = #{lockNum}</if>
|
<if test="lockName != null and lockName != ''"> and lock_name like '%'||#{lockName}||'%'</if>
|
<if test="imgPositionTop != null and imgPositionTop != ''"> and img_position_top = #{imgPositionTop}</if>
|
<if test="imgPositionLeft != null and imgPositionLeft != ''"> and img_position_left = #{imgPositionLeft}</if>
|
<if test="carId != null and carId != ''"> and car_id = #{carId}</if>
|
<if test="enable != null and enable != ''"> and enable = #{enable}</if>
|
<if test="restartState != null and restartState != ''"> and restart_state = #{restartState}</if>
|
<if test="onlineTime != null and onlineTime != ''"> and online_time = #{onlineTime}</if>
|
</where>
|
</select>
|
|
<select id="selectArdTankLockById" parameterType="String" resultMap="ArdTankLockResult">
|
<include refid="selectArdTankLockVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertArdTankLock" parameterType="ArdTankLock">
|
insert into ard_tank_lock
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="lockNum != null">lock_num,</if>
|
<if test="lockName != null">lock_name,</if>
|
<if test="imgPositionTop != null">img_position_top,</if>
|
<if test="imgPositionLeft != null">img_position_left,</if>
|
<if test="carId != null">car_id,</if>
|
<if test="enable != null">enable,</if>
|
<if test="restartState != null">restart_state,</if>
|
<if test="onlineTime != null">online_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="lockNum != null">#{lockNum},</if>
|
<if test="lockName != null">#{lockName},</if>
|
<if test="imgPositionTop != null">#{imgPositionTop},</if>
|
<if test="imgPositionLeft != null">#{imgPositionLeft},</if>
|
<if test="carId != null">#{carId},</if>
|
<if test="enable != null">#{enable},</if>
|
<if test="restartState != null">#{restartState},</if>
|
<if test="onlineTime != null">#{onlineTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateArdTankLock" parameterType="ArdTankLock">
|
update ard_tank_lock
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="lockNum != null">lock_num = #{lockNum},</if>
|
<if test="lockName != null">lock_name = #{lockName},</if>
|
<if test="imgPositionTop != null">img_position_top = #{imgPositionTop},</if>
|
<if test="imgPositionLeft != null">img_position_left = #{imgPositionLeft},</if>
|
<if test="carId != null">car_id = #{carId},</if>
|
<if test="enable != null">enable = #{enable},</if>
|
<if test="restartState != null">restart_state = #{restartState},</if>
|
<if test="onlineTime != null">online_time = #{onlineTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteArdTankLockById" parameterType="String">
|
delete from ard_tank_lock where id = #{id}
|
</delete>
|
|
<delete id="deleteArdTankLockByIds" parameterType="String">
|
delete from ard_tank_lock where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="getAll" resultMap="ArdTankLockResult">
|
select * from ard_tank_lock atl order by atl.car_id,lock_num
|
</select>
|
|
<insert id="insertArdTankLocks" parameterType="com.ruoyi.sy.domain.ArdTankLock" >
|
insert into ard_tank_lock (id, lock_num, lock_name,
|
img_position_top, img_position_left, car_id,
|
enable, restart_state, online_time)
|
values
|
<foreach collection ="ardTankLocks" item="ardTankLock" separator =",">
|
(#{ardTankLock.id},#{ardTankLock.lockNum},#{ardTankLock.lockName},
|
#{ardTankLock.imgPositionTop},#{ardTankLock.imgPositionLeft},
|
#{ardTankLock.carId},#{ardTankLock.enable},#{ardTankLock.restartState},
|
#{ardTankLock.onlineTime})
|
</foreach >
|
</insert>
|
|
<select id="getLockByCarId" resultMap="ArdTankLockResult" parameterType="java.lang.String">
|
select * from ard_tank_lock atl where car_id = #{carId} order by atl.lock_num
|
</select>
|
|
<delete id="deleteLockByCarId" parameterType="java.lang.String">
|
delete from ard_tank_lock where car_id = #{carId}
|
</delete>
|
|
<delete id="deleteArdTankLockByIdSet" >
|
delete from ard_tank_lock where id in
|
<foreach item="id" collection="idSet" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
|
<select id="selectArdTankLockTotal" resultType="java.lang.Long">
|
select count(distinct atl.car_id) from ard_tank_lock atl
|
</select>
|
|
<select id="getLockByCarIdList" resultType="com.ruoyi.sy.domain.ArdTankLock" >
|
select * from ard_tank_lock atl where car_id in
|
<foreach item="id" collection="carIdList" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
order by atl.car_id,lock_num
|
</select>
|
|
<select id="selectArdTankLockAllTotal" resultType="java.lang.Long">
|
select count(*) from ard_tank_lock atl
|
</select>
|
|
<select id="selectArdTankLockTotalByCarIdList" resultType="java.lang.Long">
|
select count(*) from ard_tank_lock where car_id in
|
<foreach item="id" collection="carIdList" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</select>
|
|
<delete id="deleteArdTankLockAndWallByCarIds" >
|
delete from ard_tank_wall_lock atwl where atwl.lock_id in (
|
select atl.id from ard_tank_lock atl
|
where atl.car_id in
|
<foreach item="carId" collection="carIds" open="(" separator="," close=")">
|
#{carId}
|
</foreach>
|
);
|
delete from ard_tank_lock atl
|
where atl.car_id in
|
<foreach item="carId" collection="carIds" open="(" separator="," close=")">
|
#{carId}
|
</foreach>
|
</delete>
|
</mapper>
|