wms_serve_xugongteji/ruoyi-system/src/main/resources/mapper/app/AppLocationMapper.xml

117 lines
6.0 KiB
XML
Raw Normal View History

2025-01-15 10:28:03 +08:00
<?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.app.mapper.AppLocationMapper">
<resultMap type="AppLocation" id="AppLocationResult">
<result property="locationId" column="location_id" />
<result property="locationType" column="location_type" />
<result property="locationStatus" column="location_status" />
<result property="outerId" column="outer_id" />
<result property="areaId" column="area_id" />
<result property="tunnelId" column="tunnel_id" />
<result property="equipmentId" column="equipment_id" />
<result property="wRow" column="w_row" />
<result property="wCol" column="w_col" />
<result property="wLayer" column="w_layer" />
<result property="wDepth" column="w_depth" />
<result property="isLock" column="is_lock" />
<result property="vehicleId" column="vehicle_id" />
<result property="remark" column="remark" />
</resultMap>
<sql id="selectAppLocationVo">
select location_id, location_type, location_status, outer_id, area_id, tunnel_id, equipment_id, w_row, w_col, w_layer, w_depth, is_lock, vehicle_id, remark from app_location
</sql>
<select id="selectAppLocationList" parameterType="AppLocation" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/>
<where>
<if test="locationType != null "> and location_type = #{locationType}</if>
<if test="locationStatus != null "> and location_status = #{locationStatus}</if>
<if test="outerId != null and outerId != ''"> and outer_id = #{outerId}</if>
<if test="areaId != null "> and area_id = #{areaId}</if>
<if test="tunnelId != null "> and tunnel_id = #{tunnelId}</if>
<if test="equipmentId != null "> and equipment_id = #{equipmentId}</if>
<if test="wRow != null "> and w_row = #{wRow}</if>
<if test="wCol != null "> and w_col = #{wCol}</if>
<if test="wLayer != null "> and w_layer = #{wLayer}</if>
<if test="wDepth != null "> and w_depth = #{wDepth}</if>
<if test="isLock != null "> and is_lock = #{isLock}</if>
<if test="vehicleId != null and vehicleId != ''"> and vehicle_id = #{vehicleId}</if>
</where>
</select>
<select id="selectAppLocationByLocationId" parameterType="String" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/>
where location_id = #{locationId}
</select>
<insert id="insertAppLocation" parameterType="AppLocation">
insert into app_location
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="locationId != null">location_id,</if>
<if test="locationType != null">location_type,</if>
<if test="locationStatus != null">location_status,</if>
<if test="outerId != null">outer_id,</if>
<if test="areaId != null">area_id,</if>
<if test="tunnelId != null">tunnel_id,</if>
<if test="equipmentId != null">equipment_id,</if>
<if test="wRow != null">w_row,</if>
<if test="wCol != null">w_col,</if>
<if test="wLayer != null">w_layer,</if>
<if test="wDepth != null">w_depth,</if>
<if test="isLock != null">is_lock,</if>
<if test="vehicleId != null">vehicle_id,</if>
<if test="remark != null">remark,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="locationId != null">#{locationId},</if>
<if test="locationType != null">#{locationType},</if>
<if test="locationStatus != null">#{locationStatus},</if>
<if test="outerId != null">#{outerId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="tunnelId != null">#{tunnelId},</if>
<if test="equipmentId != null">#{equipmentId},</if>
<if test="wRow != null">#{wRow},</if>
<if test="wCol != null">#{wCol},</if>
<if test="wLayer != null">#{wLayer},</if>
<if test="wDepth != null">#{wDepth},</if>
<if test="isLock != null">#{isLock},</if>
<if test="vehicleId != null">#{vehicleId},</if>
<if test="remark != null">#{remark},</if>
</trim>
</insert>
<update id="updateAppLocation" parameterType="AppLocation">
update app_location
<trim prefix="SET" suffixOverrides=",">
<if test="locationType != null">location_type = #{locationType},</if>
<if test="locationStatus != null">location_status = #{locationStatus},</if>
<if test="outerId != null">outer_id = #{outerId},</if>
<if test="areaId != null">area_id = #{areaId},</if>
<if test="tunnelId != null">tunnel_id = #{tunnelId},</if>
<if test="equipmentId != null">equipment_id = #{equipmentId},</if>
<if test="wRow != null">w_row = #{wRow},</if>
<if test="wCol != null">w_col = #{wCol},</if>
<if test="wLayer != null">w_layer = #{wLayer},</if>
<if test="wDepth != null">w_depth = #{wDepth},</if>
<if test="isLock != null">is_lock = #{isLock},</if>
<if test="vehicleId != null">vehicle_id = #{vehicleId},</if>
<if test="remark != null">remark = #{remark},</if>
</trim>
where location_id = #{locationId}
</update>
<delete id="deleteAppLocationByLocationId" parameterType="String">
delete from app_location where location_id = #{locationId}
</delete>
<delete id="deleteAppLocationByLocationIds" parameterType="String">
delete from app_location where location_id in
<foreach item="locationId" collection="array" open="(" separator="," close=")">
#{locationId}
</foreach>
</delete>
</mapper>