You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
9.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.hw.wms.mapper.WmsBaseWarehouseMapper">
<resultMap type="WmsBaseWarehouse" id="WmsBaseWarehouseResult">
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseInstockType" column="warehouse_instock_type" />
<result property="warehouseType" column="warehouse_type" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="warehouseCategoryId" column="warehouse_category_id" />
<result property="postId" column="post_id" />
<result property="multiRowType" column="multi_row_type" />
<result property="workbinFlag" column="workbin_flag" />
<result property="warehouseLocation" column="warehouse_location" />
<result property="activeFlag" column="active_flag" />
<result property="remark" column="remark" />
<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="delFlag" column="del_flag" />
<result property="factoryId" column="factory_id" />
<result property="dataSource" column="data_source" />
<result property="schame" column="schame" />
<result property="lineFlag" column="line_flag" />
</resultMap>
<sql id="selectWmsBaseWarehouseVo">
select warehouse_id, warehouse_instock_type, warehouse_type, warehouse_code, warehouse_name, warehouse_category_id, post_id, multi_row_type, workbin_flag, warehouse_location, active_flag, remark, create_by, create_time, update_by, update_time, del_flag, factory_id, data_source, schame, line_flag from wms_base_warehouse
</sql>
<select id="selectWmsBaseWarehouseList" parameterType="WmsBaseWarehouse" resultMap="WmsBaseWarehouseResult">
<include refid="selectWmsBaseWarehouseVo"/>
<where>
<if test="warehouseInstockType != null and warehouseInstockType != ''"> and warehouse_instock_type = #{warehouseInstockType}</if>
<if test="warehouseType != null and warehouseType != ''"> and warehouse_type = #{warehouseType}</if>
<if test="warehouseCode != null and warehouseCode != ''"> and warehouse_code = #{warehouseCode}</if>
<if test="warehouseName != null and warehouseName != ''"> and warehouse_name like concat('%', #{warehouseName}, '%')</if>
<if test="warehouseCategoryId != null "> and warehouse_category_id = #{warehouseCategoryId}</if>
<if test="postId != null "> and post_id = #{postId}</if>
<if test="multiRowType != null and multiRowType != ''"> and multi_row_type = #{multiRowType}</if>
<if test="workbinFlag != null and workbinFlag != ''"> and workbin_flag = #{workbinFlag}</if>
<if test="warehouseLocation != null and warehouseLocation != ''"> and warehouse_location = #{warehouseLocation}</if>
<if test="activeFlag != null and activeFlag != ''"> and active_flag = #{activeFlag}</if>
<if test="factoryId != null "> and factory_id = #{factoryId}</if>
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if>
<if test="schame != null and schame != ''"> and schame = #{schame}</if>
<if test="lineFlag != null and lineFlag != ''"> and line_flag = #{lineFlag}</if>
</where>
</select>
<select id="selectWmsBaseWarehouseByWarehouseId" parameterType="Long" resultMap="WmsBaseWarehouseResult">
<include refid="selectWmsBaseWarehouseVo"/>
where warehouse_id = #{warehouseId}
</select>
<insert id="insertWmsBaseWarehouse" parameterType="WmsBaseWarehouse" useGeneratedKeys="true" keyProperty="warehouseId">
insert into wms_base_warehouse
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="warehouseInstockType != null and warehouseInstockType != ''">warehouse_instock_type,</if>
<if test="warehouseType != null and warehouseType != ''">warehouse_type,</if>
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code,</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name,</if>
<if test="warehouseCategoryId != null">warehouse_category_id,</if>
<if test="postId != null">post_id,</if>
<if test="multiRowType != null and multiRowType != ''">multi_row_type,</if>
<if test="workbinFlag != null">workbin_flag,</if>
<if test="warehouseLocation != null">warehouse_location,</if>
<if test="activeFlag != null and activeFlag != ''">active_flag,</if>
<if test="remark != null">remark,</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="delFlag != null">del_flag,</if>
<if test="factoryId != null">factory_id,</if>
<if test="dataSource != null">data_source,</if>
<if test="schame != null">schame,</if>
<if test="lineFlag != null">line_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="warehouseInstockType != null and warehouseInstockType != ''">#{warehouseInstockType},</if>
<if test="warehouseType != null and warehouseType != ''">#{warehouseType},</if>
<if test="warehouseCode != null and warehouseCode != ''">#{warehouseCode},</if>
<if test="warehouseName != null and warehouseName != ''">#{warehouseName},</if>
<if test="warehouseCategoryId != null">#{warehouseCategoryId},</if>
<if test="postId != null">#{postId},</if>
<if test="multiRowType != null and multiRowType != ''">#{multiRowType},</if>
<if test="workbinFlag != null">#{workbinFlag},</if>
<if test="warehouseLocation != null">#{warehouseLocation},</if>
<if test="activeFlag != null and activeFlag != ''">#{activeFlag},</if>
<if test="remark != null">#{remark},</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="delFlag != null">#{delFlag},</if>
<if test="factoryId != null">#{factoryId},</if>
<if test="dataSource != null">#{dataSource},</if>
<if test="schame != null">#{schame},</if>
<if test="lineFlag != null">#{lineFlag},</if>
</trim>
</insert>
<update id="updateWmsBaseWarehouse" parameterType="WmsBaseWarehouse">
update wms_base_warehouse
<trim prefix="SET" suffixOverrides=",">
<if test="warehouseInstockType != null and warehouseInstockType != ''">warehouse_instock_type = #{warehouseInstockType},</if>
<if test="warehouseType != null and warehouseType != ''">warehouse_type = #{warehouseType},</if>
<if test="warehouseCode != null and warehouseCode != ''">warehouse_code = #{warehouseCode},</if>
<if test="warehouseName != null and warehouseName != ''">warehouse_name = #{warehouseName},</if>
<if test="warehouseCategoryId != null">warehouse_category_id = #{warehouseCategoryId},</if>
<if test="postId != null">post_id = #{postId},</if>
<if test="multiRowType != null and multiRowType != ''">multi_row_type = #{multiRowType},</if>
<if test="workbinFlag != null">workbin_flag = #{workbinFlag},</if>
<if test="warehouseLocation != null">warehouse_location = #{warehouseLocation},</if>
<if test="activeFlag != null and activeFlag != ''">active_flag = #{activeFlag},</if>
<if test="remark != null">remark = #{remark},</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="delFlag != null">del_flag = #{delFlag},</if>
<if test="factoryId != null">factory_id = #{factoryId},</if>
<if test="dataSource != null">data_source = #{dataSource},</if>
<if test="schame != null">schame = #{schame},</if>
<if test="lineFlag != null">line_flag = #{lineFlag},</if>
</trim>
where warehouse_id = #{warehouseId}
</update>
<delete id="deleteWmsBaseWarehouseByWarehouseId" parameterType="Long">
delete from wms_base_warehouse where warehouse_id = #{warehouseId}
</delete>
<delete id="deleteWmsBaseWarehouseByWarehouseIds" parameterType="String">
delete from wms_base_warehouse where warehouse_id in
<foreach item="warehouseId" collection="array" open="(" separator="," close=")">
#{warehouseId}
</foreach>
</delete>
</mapper>