wms_server_yaxinke_yangzhou/src/main/resources/mapper/StandMapper.xml
2024-07-04 07:43:04 +08:00

92 lines
4.4 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.wms.mapper.StandMapper">
<resultMap type="Stand" id="StandMap">
<result property="standId" column="stand_id"/>
<result property="allowIn" column="allow_in"/>
<result property="allowOut" column="allow_out"/>
<result property="taskId" column="task_id"/>
<result property="isLock" column="is_lock"/>
<result property="standStatus" column="stand_status"/>
<result property="equipmentId" column="equipment_id"/>
<result property="areaId" column="area_id"/>
<result property="standType" column="stand_type"/>
<result property="standIp" column="stand_ip"/>
</resultMap>
<sql id="selectAll">
select stand_id, allow_in, allow_out, task_id, is_lock, stand_status, equipment_id, area_id, stand_type, stand_ip
from tbl_app_stand
</sql>
<select id="selStands" parameterType="Stand" resultMap="StandMap">
<include refid="selectAll"/>
<where>
<if test="standId != null and standId != ''"> and stand_id = #{standId}</if>
<if test="allowIn != null"> and allow_in = #{allowIn}</if>
<if test="allowOut != null"> and allow_out = #{allowOut}</if>
<if test="taskId != null and taskId != ''"> and task_id = #{taskId}</if>
<if test="isLock != null"> and is_lock = #{isLock}</if>
<if test="standStatus != null"> and stand_status = #{standStatus}</if>
<if test="equipmentId != null"> and equipment_id = #{equipmentId}</if>
<if test="areaId != null"> and area_id = #{areaId}</if>
<if test="standType != null"> and stand_type = #{standType}</if>
<if test="standIp != null and standIp != ''"> and stand_ip = #{standIp}</if>
</where>
order by stand_type
</select>
<select id="selStandById" parameterType="String" resultMap="StandMap">
<include refid="selectAll"/>
where stand_id = #{standId}
</select>
<insert id="addStand" parameterType="Stand">
insert into tbl_app_stand
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="standId != null">stand_id,</if>
<if test="allowIn != null">allow_in,</if>
<if test="allowOut != null">allow_out,</if>
<if test="taskId != null">task_id,</if>
<if test="isLock != null">is_lock,</if>
<if test="standStatus != null">stand_status,</if>
<if test="equipmentId != null">equipment_id,</if>
<if test="areaId != null">area_id,</if>
<if test="standType != null">stand_type,</if>
<if test="standIp != null">stand_ip,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="standId != null">#{standId},</if>
<if test="allowIn != null">#{allowIn},</if>
<if test="allowOut != null">#{allowOut},</if>
<if test="taskId != null">#{taskId},</if>
<if test="isLock != null">#{isLock},</if>
<if test="standStatus != null">#{standStatus},</if>
<if test="equipmentId != null">#{equipmentId},</if>
<if test="areaId != null">#{areaId},</if>
<if test="standType != null">#{standType},</if>
<if test="standIp != null">#{standIp},</if>
</trim>
</insert>
<update id="modifyStand" parameterType="Stand">
update tbl_app_stand
<trim prefix="SET" suffixOverrides=",">
<if test="allowIn != null">allow_in = #{allowIn},</if>
<if test="allowOut != null">allow_out = #{allowOut},</if>
<if test="taskId != null">task_id = #{taskId},</if>
<if test="isLock != null">is_lock = #{isLock},</if>
<if test="standStatus != null">stand_status = #{standStatus},</if>
<if test="equipmentId != null">equipment_id = #{equipmentId},</if>
<if test="areaId != null">area_id = #{areaId},</if>
<if test="standType != null">stand_type = #{standType},</if>
<if test="standIp != null">stand_ip = #{standIp},</if>
</trim>
where stand_id = #{standId}
</update>
<delete id="deleteStand" parameterType="String">
delete from tbl_app_stand where stand_id = #{standId}
</delete>
</mapper>