| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?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.MaterialClassMapper">
- <!-- 查询物料类别 -->
- <select id="getMaterialClass" resultType="com.tld.model.MaterialClass">
- select
- a.wllb_code,
- a.storage_location_code,
- b.storage_location_name as storageLocationName,
- c.name as wllbName,
- a.id
- from tld_material_class a
- left join tld_storage_location b on a.storage_location_code = b.storage_location_code
- left join tld_material c on a.wllb_code = c.tld_id
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="storageLocationCode != null and storageLocationCode != ''">
- and a.storage_location_code = #{storageLocationCode}
- </if>
- <if test="id != null and id != ''">
- and a.id = #{id}
- </if>
- <if test="wllbCode != null and wllbCode != ''">
- and a.wllb_code = #{wllbCode}
- </if>
- </trim>
- </select>
- <!-- 删除类别表 -->
- <delete id="delMaterialClass">
- delete from tld_material_class where id = #{id}
- </delete>
- <!-- 新增类别表 -->
- <insert id="addMaterialClass">
- insert into tld_material_class(storage_location_code,wllb_code) values(#{storageLocationCode}, #{wllbCode})
- </insert>
- <!-- 修改类别表 -->
- <update id="updateMaterialClass">
- update tld_material_class
- <set>
- <trim suffixOverrides=",">
- <if test="storageLocationCode != null and storageLocationCode != ''">
- storage_location_code = #{storageLocationCode},
- </if>
- <if test="wllbCode != null and wllbCode != ''">
- wllb_code = #{wllbCode},
- </if>
- </trim>
- </set>
- where id = #{id}
- </update>
- <!-- 修改物料字典内容 -->
- <update id="updateMaterial">
- update tld_material
- <set>
- <trim suffixOverrides=",">
- <if test="size != null and size != ''">
- size = #{size},
- </if>
- <if test="materialType != null and materialType != ''">
- wllb_class = #{materialType},
- </if>
- <if test="isNotDisable != null and isNotDisable != ''">
- is_not_disable = #{isNotDisable},
- </if>
- <if test="isRecommend != null and isRecommend != ''">
- is_recommend = #{isRecommend},
- </if>
- <if test="partType != null and partType != ''">
- part_type = #{partType},
- </if>
- </trim>
- </set>
- where tld_id = #{id}
- </update>
- </mapper>
|