123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?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.DictionaryMapper">
- <!-- 查询字典表明 -->
- <select id="getTableName" resultType="String">
- select table_name from tld_dictionary_pulic where name = #{type}
- </select>
- <!-- 物料字典新增 -->
- <insert id="addMaterial">
- insert into tld_material(code,name,tld_id,specification_and_model,unit_of_measurement,size,is_not_disable,is_recommend)
- values(#{code},#{name},#{tldId},#{specificationAndModel},#{unitOfMeasurement},'0','0','0')
- </insert>
- <!-- 字典新增 -->
- <insert id="addDictionary">
- insert into ${tableName}(code,name,tld_id)
- values(#{code},#{name},#{tldId})
- </insert>
- <!-- 查询字典内容 -->
- <select id="getDictionary" resultType="com.tld.model.Dictionary">
- select * from ${tableName}
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="name != null and name != ''">
- and name = #{name}
- </if>
- <if test="code != null and code != ''">
- and code = #{code}
- </if>
- <if test="tldId != null and tldId != ''">
- and tld_id = #{tldId}
- </if>
- </trim>
- </select>
- <!-- 查询字典内容分页 -->
- <select id="getDictionaryPage" resultType="com.tld.model.Dictionary">
- select
- a.*,b.name as materialType
- from ${tableName} a
- left join tld_material_type b on a.wllb_class = b.tld_id
- <trim prefix="WHERE" prefixOverrides="and |or">
- <if test="name != null and name != ''">
- and a.name = #{name}
- </if>
- <if test="code != null and code != ''">
- and a.code = #{code}
- </if>
- <if test="tldId != null and tldId != ''">
- and a.tld_id = #{tldId}
- </if>
- </trim>
- </select>
- <!-- 库账对存字典新增 -->
- <insert id="addTreasuryAccount">
- insert into tld_treasury_account(material_id,code,name,num)
- values(#{materialId},#{code},#{name},#{num})
- </insert>
- </mapper>
|