94 lines
5.1 KiB
XML
94 lines
5.1 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.ruoyi.bas.roadway.mapper.BasRoadwayMapper">
|
|
|
|
<resultMap type="BasRoadway" id="BasRoadwayResult">
|
|
<result property="id" column="id" />
|
|
<result property="roadwayId" column="roadway_id" />
|
|
<result property="warehouseId" column="warehouse_id" />
|
|
<result property="roadwayName" column="roadway_name" />
|
|
<result property="deviceId" column="device_id" />
|
|
<result property="inLocked" column="in_locked" />
|
|
<result property="outLocked" column="out_locked" />
|
|
<result property="inLocked2" column="in_locked2" />
|
|
<result property="outLocked2" column="out_locked2" />
|
|
</resultMap>
|
|
|
|
<sql id="selectBasRoadwayVo">
|
|
select id, roadway_id, warehouse_id, roadway_name, device_id, in_locked, out_locked, in_locked2, out_locked2 from bas_roadway
|
|
</sql>
|
|
|
|
<select id="selectBasRoadwayList" parameterType="BasRoadway" resultMap="BasRoadwayResult">
|
|
<include refid="selectBasRoadwayVo"/>
|
|
<where>
|
|
<if test="roadwayId != null and roadwayId != ''"> and roadway_id like concat('%', #{roadwayId}, '%')</if>
|
|
<if test="warehouseId != null and warehouseId != ''"> and warehouse_id like concat('%', #{warehouseId}, '%')</if>
|
|
<if test="roadwayName != null and roadwayName != ''"> and roadway_name like concat('%', #{roadwayName}, '%')</if>
|
|
<if test="deviceId != null and deviceId != ''"> and device_id like concat('%', #{deviceId}, '%')</if>
|
|
<if test="inLocked != null and inLocked != ''"> and in_locked like concat('%', #{inLocked}, '%')</if>
|
|
<if test="outLocked != null and outLocked != ''"> and out_locked like concat('%', #{outLocked}, '%')</if>
|
|
<if test="inLocked2 != null and inLocked2 != ''"> and in_locked2 like concat('%', #{inLocked2}, '%')</if>
|
|
<if test="outLocked2 != null and outLocked2 != ''"> and out_locked2 like concat('%', #{outLocked2}, '%')</if>
|
|
</where>
|
|
</select>
|
|
|
|
<select id="selectBasRoadwayById" parameterType="String" resultMap="BasRoadwayResult">
|
|
<include refid="selectBasRoadwayVo"/>
|
|
where id = #{id}
|
|
</select>
|
|
|
|
<insert id="insertBasRoadway" parameterType="BasRoadway">
|
|
insert into bas_roadway
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">id,</if>
|
|
<if test="roadwayId != null and roadwayId != ''">roadway_id,</if>
|
|
<if test="warehouseId != null and warehouseId != ''">warehouse_id,</if>
|
|
<if test="roadwayName != null">roadway_name,</if>
|
|
<if test="deviceId != null">device_id,</if>
|
|
<if test="inLocked != null and inLocked != ''">in_locked,</if>
|
|
<if test="outLocked != null and outLocked != ''">out_locked,</if>
|
|
<if test="inLocked2 != null and inLocked2 != ''">in_locked2,</if>
|
|
<if test="outLocked2 != null and outLocked2 != ''">out_locked2,</if>
|
|
</trim>
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
<if test="id != null and id != ''">#{id},</if>
|
|
<if test="roadwayId != null and roadwayId != ''">#{roadwayId},</if>
|
|
<if test="warehouseId != null and warehouseId != ''">#{warehouseId},</if>
|
|
<if test="roadwayName != null">#{roadwayName},</if>
|
|
<if test="deviceId != null">#{deviceId},</if>
|
|
<if test="inLocked != null and inLocked != ''">#{inLocked},</if>
|
|
<if test="outLocked != null and outLocked != ''">#{outLocked},</if>
|
|
<if test="inLocked2 != null and inLocked2 != ''">#{inLocked2},</if>
|
|
<if test="outLocked2 != null and outLocked2 != ''">#{outLocked2},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<update id="updateBasRoadway" parameterType="BasRoadway">
|
|
update bas_roadway
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
<if test="roadwayId != null and roadwayId != ''">roadway_id = #{roadwayId},</if>
|
|
<if test="warehouseId != null and warehouseId != ''">warehouse_id = #{warehouseId},</if>
|
|
<if test="roadwayName != null">roadway_name = #{roadwayName},</if>
|
|
<if test="deviceId != null">device_id = #{deviceId},</if>
|
|
<if test="inLocked != null and inLocked != ''">in_locked = #{inLocked},</if>
|
|
<if test="outLocked != null and outLocked != ''">out_locked = #{outLocked},</if>
|
|
<if test="inLocked2 != null and inLocked2 != ''">in_locked2 = #{inLocked2},</if>
|
|
<if test="outLocked2 != null and outLocked2 != ''">out_locked2 = #{outLocked2},</if>
|
|
</trim>
|
|
where id = #{id}
|
|
</update>
|
|
|
|
<delete id="deleteBasRoadwayById" parameterType="String">
|
|
delete from bas_roadway where id = #{id}
|
|
</delete>
|
|
|
|
<delete id="deleteBasRoadwayByIds" parameterType="String">
|
|
delete from bas_roadway where id in
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
#{id}
|
|
</foreach>
|
|
</delete>
|
|
</mapper>
|