|
|
@@ -0,0 +1,396 @@
|
|
|
+<?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.usoftchina.saas.document.mapper.BomDetailMapper" >
|
|
|
+ <resultMap id="BaseResultMap" type="com.usoftchina.saas.document.entities.BomDetail" >
|
|
|
+ <id column="bd_id" property="id" jdbcType="INTEGER" />
|
|
|
+ <result column="bd_bomid" property="bd_bomid" jdbcType="INTEGER" />
|
|
|
+ <result column="bd_detno" property="bd_detno" jdbcType="INTEGER" />
|
|
|
+ <result column="bd_sonid" property="bd_sonid" jdbcType="INTEGER" />
|
|
|
+ <result column="bd_soncode" property="bd_soncode" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_unit" property="bd_unit" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_baseqty" property="bd_baseqty" jdbcType="INTEGER" />
|
|
|
+ <result column="bd_replace" property="bd_replace" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_remark" property="bd_remark" jdbcType="VARCHAR" />
|
|
|
+ <result column="comapnyId" property="companyId" jdbcType="INTEGER" />
|
|
|
+ <result column="updaterId" property="updaterId" jdbcType="INTEGER" />
|
|
|
+ <result column="updateTime" property="updateTime" jdbcType="TIMESTAMP" />
|
|
|
+ <result column="bd_text1" property="bd_text1" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_text2" property="bd_text2" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_text3" property="bd_text3" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_text4" property="bd_text4" jdbcType="VARCHAR" />
|
|
|
+ <result column="bd_text5" property="bd_text5" jdbcType="VARCHAR" />
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List" >
|
|
|
+ bd_id, bd_bomid, bd_detno, bd_sonid, bd_soncode, bd_unit, bd_baseqty, bd_replace,
|
|
|
+ bd_remark, comapnyId, updaterId, updateTime, bd_text1, bd_text2, bd_text3, bd_text4,
|
|
|
+ bd_text5
|
|
|
+ </sql>
|
|
|
+ <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
|
|
|
+ select
|
|
|
+ <include refid="Base_Column_List" />
|
|
|
+ from bomdetail
|
|
|
+ where bd_id = #{id}
|
|
|
+ </select>
|
|
|
+ <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
|
|
|
+ delete from bomdetail
|
|
|
+ where bd_id = #{id}
|
|
|
+ </delete>
|
|
|
+ <insert id="insert" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
|
|
|
+ insert into bomdetail (bd_bomid, bd_detno,
|
|
|
+ bd_sonid, bd_soncode, bd_unit,
|
|
|
+ bd_baseqty, bd_replace, bd_remark,
|
|
|
+ comapnyId, updaterId, updateTime,
|
|
|
+ bd_text1, bd_text2, bd_text3,
|
|
|
+ bd_text4, bd_text5)
|
|
|
+ values ( #{bd_bomid,jdbcType=INTEGER}, #{bd_detno,jdbcType=INTEGER},
|
|
|
+ #{bd_sonid,jdbcType=INTEGER}, #{bd_soncode,jdbcType=VARCHAR}, #{bd_unit,jdbcType=VARCHAR},
|
|
|
+ #{bd_baseqty,jdbcType=INTEGER}, #{bd_replace,jdbcType=VARCHAR}, #{bd_remark,jdbcType=VARCHAR},
|
|
|
+ #{comapnyId,jdbcType=INTEGER}, #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ #{bd_text1,jdbcType=VARCHAR}, #{bd_text2,jdbcType=VARCHAR}, #{bd_text3,jdbcType=VARCHAR},
|
|
|
+ #{bd_text4,jdbcType=VARCHAR}, #{bd_text5,jdbcType=VARCHAR})
|
|
|
+ </insert>
|
|
|
+ <insert id="insertSelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
|
|
|
+ insert into bomdetail
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="bd_bomid != null" >
|
|
|
+ bd_bomid,
|
|
|
+ </if>
|
|
|
+ <if test="bd_detno != null" >
|
|
|
+ bd_detno,
|
|
|
+ </if>
|
|
|
+ <if test="bd_sonid != null" >
|
|
|
+ bd_sonid,
|
|
|
+ </if>
|
|
|
+ <if test="bd_soncode != null" >
|
|
|
+ bd_soncode,
|
|
|
+ </if>
|
|
|
+ <if test="bd_unit != null" >
|
|
|
+ bd_unit,
|
|
|
+ </if>
|
|
|
+ <if test="bd_baseqty != null" >
|
|
|
+ bd_baseqty,
|
|
|
+ </if>
|
|
|
+ <if test="bd_replace != null" >
|
|
|
+ bd_replace,
|
|
|
+ </if>
|
|
|
+ <if test="bd_remark != null" >
|
|
|
+ bd_remark,
|
|
|
+ </if>
|
|
|
+ <if test="comapnyId != null" >
|
|
|
+ comapnyId,
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="bd_text1 != null" >
|
|
|
+ bd_text1,
|
|
|
+ </if>
|
|
|
+ <if test="bd_text2 != null" >
|
|
|
+ bd_text2,
|
|
|
+ </if>
|
|
|
+ <if test="bd_text3 != null" >
|
|
|
+ bd_text3,
|
|
|
+ </if>
|
|
|
+ <if test="bd_text4 != null" >
|
|
|
+ bd_text4,
|
|
|
+ </if>
|
|
|
+ <if test="bd_text5 != null" >
|
|
|
+ bd_text5,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="bd_bomid != null" >
|
|
|
+ #{bd_bomid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_detno != null" >
|
|
|
+ #{bd_detno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_sonid != null" >
|
|
|
+ #{bd_sonid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_soncode != null" >
|
|
|
+ #{bd_soncode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_unit != null" >
|
|
|
+ #{bd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_baseqty != null" >
|
|
|
+ #{bd_baseqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_replace != null" >
|
|
|
+ #{bd_replace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_remark != null" >
|
|
|
+ #{bd_remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comapnyId != null" >
|
|
|
+ #{comapnyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text1 != null" >
|
|
|
+ #{bd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text2 != null" >
|
|
|
+ #{bd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text3 != null" >
|
|
|
+ #{bd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text4 != null" >
|
|
|
+ #{bd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text5 != null" >
|
|
|
+ #{bd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </insert>
|
|
|
+ <update id="updateByPrimaryKeySelective" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
|
|
|
+ update bomdetail
|
|
|
+ <set >
|
|
|
+ <if test="bd_bomid != null" >
|
|
|
+ bd_bomid = #{bd_bomid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_detno != null" >
|
|
|
+ bd_detno = #{bd_detno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_sonid != null" >
|
|
|
+ bd_sonid = #{bd_sonid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_soncode != null" >
|
|
|
+ bd_soncode = #{bd_soncode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_unit != null" >
|
|
|
+ bd_unit = #{bd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_baseqty != null" >
|
|
|
+ bd_baseqty = #{bd_baseqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_replace != null" >
|
|
|
+ bd_replace = #{bd_replace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_remark != null" >
|
|
|
+ bd_remark = #{bd_remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comapnyId != null" >
|
|
|
+ comapnyId = #{comapnyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text1 != null" >
|
|
|
+ bd_text1 = #{bd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text2 != null" >
|
|
|
+ bd_text2 = #{bd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text3 != null" >
|
|
|
+ bd_text3 = #{bd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text4 != null" >
|
|
|
+ bd_text4 = #{bd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text5 != null" >
|
|
|
+ bd_text5 = #{bd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where bd_id = #{id}
|
|
|
+ </update>
|
|
|
+ <update id="updateByPrimaryKey" parameterType="com.usoftchina.saas.document.entities.BomDetail" >
|
|
|
+ update bomdetail
|
|
|
+ set bd_bomid = #{bd_bomid,jdbcType=INTEGER},
|
|
|
+ bd_detno = #{bd_detno,jdbcType=INTEGER},
|
|
|
+ bd_sonid = #{bd_sonid,jdbcType=INTEGER},
|
|
|
+ bd_soncode = #{bd_soncode,jdbcType=VARCHAR},
|
|
|
+ bd_unit = #{bd_unit,jdbcType=VARCHAR},
|
|
|
+ bd_baseqty = #{bd_baseqty,jdbcType=INTEGER},
|
|
|
+ bd_replace = #{bd_replace,jdbcType=VARCHAR},
|
|
|
+ bd_remark = #{bd_remark,jdbcType=VARCHAR},
|
|
|
+ comapnyId = #{comapnyId,jdbcType=INTEGER},
|
|
|
+ updaterId = #{updaterId,jdbcType=INTEGER},
|
|
|
+ updateTime = #{updateTime,jdbcType=TIMESTAMP},
|
|
|
+ bd_text1 = #{bd_text1,jdbcType=VARCHAR},
|
|
|
+ bd_text2 = #{bd_text2,jdbcType=VARCHAR},
|
|
|
+ bd_text3 = #{bd_text3,jdbcType=VARCHAR},
|
|
|
+ bd_text4 = #{bd_text4,jdbcType=VARCHAR},
|
|
|
+ bd_text5 = #{bd_text5,jdbcType=VARCHAR}
|
|
|
+ where bd_id = #{id}
|
|
|
+ </update>
|
|
|
+ <insert id="batchInsert" parameterType="java.util.List">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=",">
|
|
|
+ INSERT INTO BOMDETAIL
|
|
|
+ <trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
+ <if test="item.bd_bomid != null" >
|
|
|
+ bd_bomid,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_detno != null" >
|
|
|
+ bd_detno,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_sonid != null" >
|
|
|
+ bd_sonid,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_soncode != null" >
|
|
|
+ bd_soncode,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_unit != null" >
|
|
|
+ bd_unit,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_baseqty != null" >
|
|
|
+ bd_baseqty,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_replace != null" >
|
|
|
+ bd_replace,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_remark != null" >
|
|
|
+ bd_remark,
|
|
|
+ </if>
|
|
|
+ <if test="item.comapnyId != null" >
|
|
|
+ comapnyId,
|
|
|
+ </if>
|
|
|
+ <if test="item.updaterId != null" >
|
|
|
+ updaterId,
|
|
|
+ </if>
|
|
|
+ <if test="item.updateTime != null" >
|
|
|
+ updateTime,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_text1 != null" >
|
|
|
+ bd_text1,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_text2 != null" >
|
|
|
+ bd_text2,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_text3 != null" >
|
|
|
+ bd_text3,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_text4 != null" >
|
|
|
+ bd_text4,
|
|
|
+ </if>
|
|
|
+ <if test="item.bd_text5 != null" >
|
|
|
+ bd_text5,
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ <trim prefix="values (" suffix=")" suffixOverrides="," >
|
|
|
+ <if test="item.bd_bomid != null" >
|
|
|
+ #{item.bd_bomid},
|
|
|
+ </if>
|
|
|
+ <if test="bd_detno != null" >
|
|
|
+ #{item.bd_detno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_sonid != null" >
|
|
|
+ #{item.bd_sonid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_soncode != null" >
|
|
|
+ #{item.bd_soncode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_unit != null" >
|
|
|
+ #{item.bd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_baseqty != null" >
|
|
|
+ #{item.bd_baseqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_replace != null" >
|
|
|
+ #{item.bd_replace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_remark != null" >
|
|
|
+ #{item.bd_remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comapnyId != null" >
|
|
|
+ #{item.comapnyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ #{item.updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text1 != null" >
|
|
|
+ #{item.bd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text2 != null" >
|
|
|
+ #{item.bd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text3 != null" >
|
|
|
+ #{item.bd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text4 != null" >
|
|
|
+ #{item.bd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text5 != null" >
|
|
|
+ #{item.bd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </trim>
|
|
|
+ </foreach>
|
|
|
+ </insert>
|
|
|
+
|
|
|
+ <update id="batchUpdate" parameterType="com.usoftchina.saas.document.entities.BomDetail">
|
|
|
+ <foreach collection="list" item="item" index="index" open="" close="" separator=";">
|
|
|
+ UPDATE BOMDETAIL
|
|
|
+ <set >
|
|
|
+ <if test="item.bd_bomid != null" >
|
|
|
+ bd_bomid = #{item.bd_bomid},
|
|
|
+ </if>
|
|
|
+ <if test="bd_detno != null" >
|
|
|
+ bd_detno = #{item.bd_detno,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_sonid != null" >
|
|
|
+ bd_sonid = #{item.bd_sonid,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_soncode != null" >
|
|
|
+ bd_soncode = #{item.bd_soncode,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_unit != null" >
|
|
|
+ bd_unit = #{item.bd_unit,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_baseqty != null" >
|
|
|
+ bd_baseqty = #{item.bd_baseqty,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="bd_replace != null" >
|
|
|
+ bd_replace = #{item.bd_replace,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_remark != null" >
|
|
|
+ bd_remark = #{item.bd_remark,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="comapnyId != null" >
|
|
|
+ comapnyId = #{item.comapnyId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updaterId != null" >
|
|
|
+ updaterId = #{item.updaterId,jdbcType=INTEGER},
|
|
|
+ </if>
|
|
|
+ <if test="updateTime != null" >
|
|
|
+ updateTime = #{item.updateTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text1 != null" >
|
|
|
+ bd_text1 = #{item.bd_text1,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text2 != null" >
|
|
|
+ bd_text2 = #{item.bd_text2,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text3 != null" >
|
|
|
+ bd_text3 = #{item.bd_text3,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text4 != null" >
|
|
|
+ bd_text4 = #{item.bd_text4,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ <if test="bd_text5 != null" >
|
|
|
+ bd_text5 = #{item.bd_text5,jdbcType=VARCHAR},
|
|
|
+ </if>
|
|
|
+ </set>
|
|
|
+ where bd_id = #{item.id}
|
|
|
+ </foreach>
|
|
|
+ </update>
|
|
|
+
|
|
|
+ <delete id="deleteByFK" parameterType="java.lang.Long">
|
|
|
+ DELETE FROM BOMDETAIL
|
|
|
+ WHERE BD_BOMID=#{id}
|
|
|
+ </delete>
|
|
|
+</mapper>
|