12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- <?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.tld.mapper.StorageLocationMapper">
- <sql id="field">
- id,storage_location_code,storage_location_name,warehouse_where,storage_location_type,is_not_disable,create_time
- </sql>
- <!-- 查询库位信息 -->
- <select id="getStorage" resultType="com.tld.model.StorageLocation">
- select
- <include refid="field"/>
- from
- tld_storage_location
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="storageLocationCode != null and storageLocationCode != ''">
- and storage_location_code like CONCAT(CONCAT('%', #{storageLocationCode}), '%')
- </if>
- <if test="storageLocationName != null and storageLocationName != ''">
- and storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
- </if>
- <if test="storageLocationType != null and storageLocationType != ''">
- and storage_location_type like CONCAT(CONCAT('%', #{storageLocationType}), '%')
- </if>
- <if test="isNotDisable != null and isNotDisable != ''">
- and is_not_disable = #{isNotDisable}
- </if>
- <if test="id != null and id != ''">
- and id = #{id}
- </if>
- </trim>
- </select>
- <!-- 新增库位信息 -->
- <insert id="addStorage">
- insert into tld_storage_location(storage_location_code,storage_location_name,warehouse_where,storage_location_type,is_not_disable,create_time)
- values(#{storageLocationCode},#{storageLocationName},#{warehouseWhere},#{storageLocationType},#{isNotDisable},DATE_FORMAT(NOW(), '%Y-%m-%d'))
- </insert>
- <!-- 删除库位信息 -->
- <delete id="delStorage">
- delete from tld_storage_location where id = #{id}
- </delete>
- <!-- 修改库位信息 -->
- <update id="updateStorage">
- update tld_storage_location
- <set>
- <trim suffixOverrides=",">
- <if test="storageLocationCode != null and storageLocationCode != ''">
- storage_location_code = #{storageLocationCode},
- </if>
- <if test="storageLocationName != null and storageLocationName != ''">
- storage_location_name = #{storageLocationName},
- </if>
- <if test="warehouseWhere != null and warehouseWhere != ''">
- warehouse_where = #{warehouseWhere},
- </if>
- <if test="storageLocationType != null and storageLocationType != ''">
- storage_location_type = #{storageLocationType},
- </if>
- <if test="isNotDisable != null and isNotDisable != ''">
- is_not_disable = #{isNotDisable},
- </if>
- </trim>
- </set>
- where id = #{id}
- </update>
- <!-- 导出数据查询 -->
- <select id="export" resultType="java.util.LinkedHashMap">
- select storage_location_code,storage_location_name,warehouse_where,storage_location_type,is_not_disable,create_time
- from tld_storage_location
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="storageLocationCode != null and storageLocationCode != ''">
- and storage_location_code like CONCAT(CONCAT('%', #{storageLocationCode}), '%')
- </if>
- <if test="storageLocationName != null and storageLocationName != ''">
- and storage_location_name like CONCAT(CONCAT('%', #{storageLocationName}), '%')
- </if>
- <if test="storageLocationType != null and storageLocationType != ''">
- and storage_location_type like CONCAT(CONCAT('%', #{storageLocationType}), '%')
- </if>
- <if test="isNotDisable != null and isNotDisable != ''">
- and is_not_disable = #{isNotDisable}
- </if>
- <if test="id != null and id != ''">
- and id = #{id}
- </if>
- </trim>
- </select>
- </mapper>
|