184 lines
9.0 KiB
XML
184 lines
9.0 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.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"/>
|
|
<result property="isWorking" column="is_working"/>
|
|
</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,
|
|
is_working
|
|
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>
|
|
<if test="isWorking != null ">and is_working = #{isWorking}</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>
|
|
<if test="isWorking != null">is_working,</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>
|
|
<if test="isWorking != null">#{isWorking},</if>
|
|
</trim>
|
|
</insert>
|
|
|
|
<insert id="insertAppLocationBatch" parameterType="java.util.List">
|
|
insert into app_location
|
|
<foreach collection="list" item="location" separator=",">
|
|
(
|
|
<trim prefixOverrides=",">
|
|
<if test="location.locationId != null">location_id,</if>
|
|
<if test="location.locationType != null">location_type,</if>
|
|
<if test="location.locationStatus != null">location_status,</if>
|
|
<if test="location.outerId != null">outer_id,</if>
|
|
<if test="location.areaId != null">area_id,</if>
|
|
<if test="location.tunnelId != null">tunnel_id,</if>
|
|
<if test="location.equipmentId != null">equipment_id,</if>
|
|
<if test="location.wRow != null">w_row,</if>
|
|
<if test="location.wCol != null">w_col,</if>
|
|
<if test="location.wLayer != null">w_layer,</if>
|
|
<if test="location.wDepth != null">w_depth,</if>
|
|
<if test="location.isLock != null">is_lock,</if>
|
|
<if test="location.vehicleId != null">vehicle_id,</if>
|
|
<if test="location.remark != null">remark,</if>
|
|
<if test="location.isWorking != null">is_working,</if>
|
|
</trim>
|
|
)
|
|
values
|
|
(
|
|
<trim prefixOverrides=",">
|
|
<if test="location.locationId != null">#{location.locationId},</if>
|
|
<if test="location.locationType != null">#{location.locationType},</if>
|
|
<if test="location.locationStatus != null">#{location.locationStatus},</if>
|
|
<if test="location.outerId != null">#{location.outerId},</if>
|
|
<if test="location.areaId != null">#{location.areaId},</if>
|
|
<if test="location.tunnelId != null">#{location.tunnelId},</if>
|
|
<if test="location.equipmentId != null">#{location.equipmentId},</if>
|
|
<if test="location.wRow != null">#{location.wRow},</if>
|
|
<if test="location.wCol != null">#{location.wCol},</if>
|
|
<if test="location.wLayer != null">#{location.wLayer},</if>
|
|
<if test="location.wDepth != null">#{location.wDepth},</if>
|
|
<if test="location.isLock != null">#{location.isLock},</if>
|
|
<if test="location.vehicleId != null">#{location.vehicleId},</if>
|
|
<if test="location.remark != null">#{location.remark},</if>
|
|
<if test="location.isWorking != null">#{location.isWorking},</if>
|
|
</trim>
|
|
)
|
|
</foreach>
|
|
</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>
|
|
<if test="isWorking != null">is_working = #{isWorking},</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> |