123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269 |
- <?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.steerinfo.ems.emsprodplanroundweight.mapper.EmsProdplanRoundWeightMapper">
- <resultMap id="BaseResultMap" type="com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight">
- <id column="FID" jdbcType="VARCHAR" property="fid" />
- <result column="PRODATE" jdbcType="VARCHAR" property="prodate" />
- <result column="MATERIALCODE" jdbcType="VARCHAR" property="materialcode" />
- <result column="MATERIALNAME" jdbcType="VARCHAR" property="materialname" />
- <result column="QTY" jdbcType="DECIMAL" property="qty" />
- <result column="UNIT" jdbcType="VARCHAR" property="unit" />
- <result column="LC_ID" jdbcType="VARCHAR" property="lcId" />
- </resultMap>
- <sql id="columns">
- FID, PRODATE, MATERIALCODE, MATERIALNAME, QTY, UNIT, LC_ID
- </sql>
- <sql id="columns_alias">
- t.FID, t.PRODATE, t.MATERIALCODE, t.MATERIALNAME, t.QTY, t.UNIT, t.LC_ID
- </sql>
- <sql id="select">
- SELECT <include refid="columns"/> FROM EMS_PRODPLAN_ROUND_WEIGHT
- </sql>
- <sql id="select_alias">
- SELECT <include refid="columns_alias"/> FROM EMS_PRODPLAN_ROUND_WEIGHT t
- </sql>
- <sql id="where">
- <where>
- <if test="fid != null and fid != ''">
- and FID = #{fid}
- </if>
- <if test="prodate != null and prodate != ''">
- and PRODATE = #{prodate}
- </if>
- <if test="materialcode != null and materialcode != ''">
- and MATERIALCODE = #{materialcode}
- </if>
- <if test="materialname != null and materialname != ''">
- and MATERIALNAME = #{materialname}
- </if>
- <if test="qty != null">
- and QTY = #{qty}
- </if>
- <if test="unit != null and unit != ''">
- and UNIT = #{unit}
- </if>
- <if test="lcId != null and lcId != ''">
- and LC_ID = #{lcId}
- </if>
- </where>
- </sql>
- <sql id="whereLike">
- <where>
- <if test="fid != null and fid != ''">
- and FID LIKE '%${fid}%'
- </if>
- <if test="prodate != null and prodate != ''">
- and PRODATE LIKE '%${prodate}%'
- </if>
- <if test="materialcode != null and materialcode != ''">
- and MATERIALCODE LIKE '%${materialcode}%'
- </if>
- <if test="materialname != null and materialname != ''">
- and MATERIALNAME LIKE '%${materialname}%'
- </if>
- <if test="qty != null">
- and QTY = #{qty}
- </if>
- <if test="unit != null and unit != ''">
- and UNIT LIKE '%${unit}%'
- </if>
- <if test="lcId != null and lcId != ''">
- and LC_ID LIKE '%${lcId}%'
- </if>
- </where>
- </sql>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.String">
- delete from EMS_PRODPLAN_ROUND_WEIGHT
- where FID = #{fid,jdbcType=VARCHAR}
- </delete>
- <delete id="deleteBySelectiveElement" parameterType="java.util.HashMap">
- delete from EMS_PRODPLAN_ROUND_WEIGHT
- where 1!=1
- <if test="prodate != null and prodate != ''">
- or PRODATE = #{prodate}
- </if>
- <if test="materialcode != null and materialcode != ''">
- or MATERIALCODE = #{materialcode}
- </if>
- <if test="materialname != null and materialname != ''">
- or MATERIALNAME = #{materialname}
- </if>
- <if test="qty != null">
- or QTY = #{qty}
- </if>
- <if test="unit != null and unit != ''">
- or UNIT = #{unit}
- </if>
- <if test="lcId != null and lcId != ''">
- or LC_ID = #{lcId}
- </if>
- </delete>
- <insert id="insert" parameterType="com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight">
- insert into EMS_PRODPLAN_ROUND_WEIGHT (FID, PRODATE, MATERIALCODE,
- MATERIALNAME, QTY, UNIT,LC_ID,REMARK)
- values (#{fid,jdbcType=VARCHAR}, #{prodate,jdbcType=VARCHAR}, #{materialcode,jdbcType=VARCHAR},
- #{materialname,jdbcType=VARCHAR}, #{qty,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR},
- #{lcId,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight">
- insert into EMS_PRODPLAN_ROUND_WEIGHT
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="fid != null">
- FID,
- </if>
- <if test="prodate != null">
- PRODATE,
- </if>
- <if test="materialcode != null">
- MATERIALCODE,
- </if>
- <if test="materialname != null">
- MATERIALNAME,
- </if>
- <if test="qty != null">
- QTY,
- </if>
- <if test="unit != null">
- UNIT,
- </if>
- <if test="lcId != null">
- LC_ID,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="fid != null">
- #{fid,jdbcType=VARCHAR},
- </if>
- <if test="prodate != null">
- #{prodate,jdbcType=VARCHAR},
- </if>
- <if test="materialcode != null">
- #{materialcode,jdbcType=VARCHAR},
- </if>
- <if test="materialname != null">
- #{materialname,jdbcType=VARCHAR},
- </if>
- <if test="qty != null">
- #{qty,jdbcType=DECIMAL},
- </if>
- <if test="unit != null">
- #{unit,jdbcType=VARCHAR},
- </if>
- <if test="lcId != null">
- #{lcId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKey" parameterType="com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight">
- update EMS_PRODPLAN_ROUND_WEIGHT
- set PRODATE = #{prodate,jdbcType=VARCHAR},
- MATERIALCODE = #{materialcode,jdbcType=VARCHAR},
- MATERIALNAME = #{materialname,jdbcType=VARCHAR},
- QTY = #{qty,jdbcType=DECIMAL},
- UNIT = #{unit,jdbcType=VARCHAR},
- LC_ID = #{lcId,jdbcType=VARCHAR}
- where FID = #{fid,jdbcType=VARCHAR}
- </update>
- <update id="updateByPrimaryKeySelective" parameterType="com.steerinfo.ems.emsprodplanroundweight.model.EmsProdplanRoundWeight">
- update EMS_PRODPLAN_ROUND_WEIGHT
- <set>
- <if test="prodate != null">
- PRODATE = #{prodate,jdbcType=VARCHAR},
- </if>
- <if test="materialcode != null">
- MATERIALCODE = #{materialcode,jdbcType=VARCHAR},
- </if>
- <if test="materialname != null">
- MATERIALNAME = #{materialname,jdbcType=VARCHAR},
- </if>
- <if test="qty != null">
- QTY = #{qty,jdbcType=DECIMAL},
- </if>
- <if test="unit != null">
- UNIT = #{unit,jdbcType=VARCHAR},
- </if>
- <if test="lcId != null">
- LC_ID = #{lcId,jdbcType=VARCHAR},
- </if>
- <if test="remark != null">
- REMARK = #{remark,jdbcType=VARCHAR},
- </if>
- </set>
- where FID = #{fid,jdbcType=VARCHAR}
- <if test="lcId != null">
- and LC_ID = #{lcId,jdbcType=VARCHAR}
- </if>
- </update>
- <select id="selectByPrimaryKey" parameterType="java.lang.String" resultMap="BaseResultMap">
- <include refid="select"/>
- where FID = #{fid,jdbcType=VARCHAR}
- </select>
- <select id="selectByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="where"/>
- </select>
- <select id="selectLikeByParameters" parameterType="java.util.HashMap" resultMap="BaseResultMap">
- <include refid="select"/>
- <include refid="whereLike"/>
- </select>
- <insert id="batchInsert" parameterType="java.util.List">
- insert into EMS_PRODPLAN_ROUND_WEIGHT
- (FID,
- PRODATE, MATERIALCODE, MATERIALNAME,
- QTY, UNIT, LC_ID
- )
- ( <foreach collection="list" item="item" separator="union all">
- select
- #{item.fid,jdbcType=VARCHAR},
- #{item.prodate,jdbcType=VARCHAR}, #{item.materialcode,jdbcType=VARCHAR}, #{item.materialname,jdbcType=VARCHAR},
- #{item.qty,jdbcType=DECIMAL}, #{item.unit,jdbcType=VARCHAR}, #{item.lcId,jdbcType=VARCHAR}
- from dual
- </foreach> )
- </insert>
- <update id="batchUpdate" parameterType="java.util.List">
- update EMS_PRODPLAN_ROUND_WEIGHT
- set
- FID=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.fid,jdbcType=VARCHAR}
- </foreach>
- ,PRODATE=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.prodate,jdbcType=VARCHAR}
- </foreach>
- ,MATERIALCODE=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.materialcode,jdbcType=VARCHAR}
- </foreach>
- ,MATERIALNAME=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.materialname,jdbcType=VARCHAR}
- </foreach>
- ,QTY=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.qty,jdbcType=DECIMAL}
- </foreach>
- ,UNIT=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.unit,jdbcType=VARCHAR}
- </foreach>
- ,LC_ID=
- <foreach collection="list" item="item" index="index" separator=" " open="case FID" close="end">
- when #{item.fid,jdbcType=VARCHAR} then #{item.lcId,jdbcType=VARCHAR}
- </foreach>
- where FID in
- <foreach collection="list" index="index" item="item" separator="," open="(" close=")">
- #{item.fid,jdbcType=VARCHAR}
- </foreach>
- </update>
- <delete id="batchDelete" parameterType="java.util.List">
- delete from EMS_PRODPLAN_ROUND_WEIGHT
- where FID in
- <foreach collection="list" item="id" open="(" close=")" separator=",">
- #{id}
- </foreach>
- </delete>
- <!-- 友情提示!!!-->
- <!-- 请将自己写的代码放在此标签之下,方便以后粘贴复制。-->
- </mapper>
|