123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- <?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.ams.box.mapper.WmsBoxInfoMapper">
- <resultMap type="WmsBoxInfo" id="WmsBoxInfoResult">
- <result property="id" column="id" />
- <result property="boxNo" column="box_no" />
- <result property="boxType" column="box_type" />
- <result property="boxRemark" column="box_remark" />
- <result property="boxState" column="box_state" />
- <result property="isEmpty" column="is_empty" />
- <result property="createBy" column="create_by" />
- <result property="createTime" column="create_time" />
- <result property="updateBy" column="update_by" />
- <result property="updateTime" column="update_time" />
- <result property="userdefine1" column="userdefine1" />
- <result property="userdefine2" column="userdefine2" />
- <result property="locationId" column="location_id" />
- <result property="isFull" column="is_full" />
- <result property="locationNo" column="location_no"/>
- </resultMap>
- <sql id="selectWmsBoxInfoVo">
- select id, box_no, box_type, box_remark, box_state, is_empty, create_by, create_time, update_by, update_time, userdefine1, userdefine2, location_id, is_full from wms_box_info
- </sql>
- <select id="selectWmsBoxInfoList" parameterType="WmsBoxInfo" resultMap="WmsBoxInfoResult">
- select t1.*,t2.location_no
- from wms_box_info t1
- left join base_location_info t2 on t2.id = t1.location_id
- <where>
- <if test="isFull != null and isFull != ''"> and is_full = #{isFull}</if>
- <if test="boxNo != null and boxNo != ''"> and box_no = #{boxNo}</if>
- <if test="locationNo != null and locationNo != ''"> and t2.location_no = #{locationNo}</if>
- <if test="locationId != null and locationId != ''"> and t1.location_id = #{locationId}</if>
- </where>
- </select>
- <select id="selectWmsBoxInfoById" parameterType="Long" resultMap="WmsBoxInfoResult">
- <include refid="selectWmsBoxInfoVo"/>
- where id = #{id}
- </select>
- <insert id="insertWmsBoxInfo" parameterType="WmsBoxInfo" useGeneratedKeys="true" keyProperty="id">
- insert into wms_box_info
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="boxNo != null">box_no,</if>
- <if test="boxType != null">box_type,</if>
- <if test="boxRemark != null">box_remark,</if>
- <if test="boxState != null">box_state,</if>
- <if test="isEmpty != null">is_empty,</if>
- <if test="createBy != null">create_by,</if>
- <if test="createTime != null">create_time,</if>
- <if test="updateBy != null">update_by,</if>
- <if test="updateTime != null">update_time,</if>
- <if test="userdefine1 != null">userdefine1,</if>
- <if test="userdefine2 != null">userdefine2,</if>
- <if test="locationId != null">location_id,</if>
- <if test="isFull != null">is_full,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="boxNo != null">#{boxNo},</if>
- <if test="boxType != null">#{boxType},</if>
- <if test="boxRemark != null">#{boxRemark},</if>
- <if test="boxState != null">#{boxState},</if>
- <if test="isEmpty != null">#{isEmpty},</if>
- <if test="createBy != null">#{createBy},</if>
- <if test="createTime != null">#{createTime},</if>
- <if test="updateBy != null">#{updateBy},</if>
- <if test="updateTime != null">#{updateTime},</if>
- <if test="userdefine1 != null">#{userdefine1},</if>
- <if test="userdefine2 != null">#{userdefine2},</if>
- <if test="locationId != null">#{locationId},</if>
- <if test="isFull != null">#{isFull},</if>
- </trim>
- </insert>
- <update id="updateWmsBoxInfo" parameterType="WmsBoxInfo">
- update wms_box_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="boxNo != null">box_no = #{boxNo},</if>
- <if test="boxType != null">box_type = #{boxType},</if>
- <if test="boxRemark != null">box_remark = #{boxRemark},</if>
- <if test="boxState != null">box_state = #{boxState},</if>
- <if test="isEmpty != null">is_empty = #{isEmpty},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
- <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
- <if test="locationId != null">location_id = #{locationId},</if>
- <if test="isFull != null">is_full = #{isFull},</if>
- </trim>
- where id = #{id}
- </update>
- <update id="updateWmsBoxInfoIsNull" parameterType="WmsBoxInfo">
- update wms_box_info
- <trim prefix="SET" suffixOverrides=",">
- location_id = null,
- <if test="boxNo != null">box_no = #{boxNo},</if>
- <if test="boxType != null">box_type = #{boxType},</if>
- <if test="boxRemark != null">box_remark = #{boxRemark},</if>
- <if test="boxState != null">box_state = #{boxState},</if>
- <if test="isEmpty != null">is_empty = #{isEmpty},</if>
- <if test="createBy != null">create_by = #{createBy},</if>
- <if test="createTime != null">create_time = #{createTime},</if>
- <if test="updateBy != null">update_by = #{updateBy},</if>
- <if test="updateTime != null">update_time = #{updateTime},</if>
- <if test="userdefine1 != null">userdefine1 = #{userdefine1},</if>
- <if test="userdefine2 != null">userdefine2 = #{userdefine2},</if>
- <if test="isFull != null">is_full = #{isFull},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteWmsBoxInfoById" parameterType="Long">
- delete from wms_box_info where id = #{id}
- </delete>
- <delete id="deleteWmsBoxInfoByIds" parameterType="String">
- delete from wms_box_info where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <update id="updateLocationBind">
- update wms_box_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="locationTo != null">location_id = #{locationTo},</if>
- <if test="isFull != null">is_full = #{isFull},</if>
- </trim>
- where location_id = #{locationFrom}
- </update>
- <update id="updateLocationBindByPalletNo">
- update wms_box_info
- <trim prefix="SET" suffixOverrides=",">
- <if test="locationTo != null">location_id = #{locationTo},</if>
- <if test="isFull != null">is_full = #{isFull},</if>
- </trim>
- where location_id = #{locationFrom} and box_no =#{palletNo}
- </update>
- <update id="unbindBox">
- update wms_box_info set location_id = '',is_full = 'N',is_empty='Y'
- where location_id = #{locationId}
- </update>
- <select id="selectWmsBoxInfoByBoxNo" parameterType="string" resultMap="WmsBoxInfoResult">
- <include refid="selectWmsBoxInfoVo"/>
- where box_no = #{boxNo}
- </select>
- <select id="selectByLocationId" parameterType="string" resultMap="WmsBoxInfoResult">
- <include refid="selectWmsBoxInfoVo"/>
- where location_id = #{locationId}
- </select>
- </mapper>
|