<?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.jcdm.main.bs.productBomChild.mapper.BsProductBomChildInfoMapper">
|
|
<resultMap type="BsProductBomChildInfo" id="BsProductBomChildInfoResult">
|
<result property="id" column="id" />
|
<result property="opCode" column="op_code" />
|
<result property="opName" column="op_name" />
|
<result property="materialCode" column="material_code" />
|
<result property="materialName" column="material_name" />
|
<result property="costQty" column="cost_qty" />
|
<result property="unit" column="unit" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="spareField3" column="spare_field_3" />
|
<result property="remark" column="remark" />
|
<result property="bomCode" column="bom_code" />
|
<result property="bomInfoId" column="bom_info_id" />
|
</resultMap>
|
|
<sql id="selectBsProductBomChildInfoVo">
|
select id, op_code, op_name, material_code, material_name, cost_qty, unit, spare_field_1, spare_field_2, spare_field_3, remark, bom_code, bom_info_id from bs_product_bom_child_info
|
</sql>
|
|
<select id="selectBsProductBomChildInfoList" parameterType="BsProductBomChildInfo" resultMap="BsProductBomChildInfoResult">
|
<include refid="selectBsProductBomChildInfoVo"/>
|
<where>
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
<if test="materialName != null and materialName != ''"> and material_name = #{materialName}</if>
|
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
|
<if test="opCode != null and opCode != ''"> and op_code = #{opCode}</if>
|
<if test="opName != null and opName != ''"> and op_name = #{opName}</if>
|
|
</where>
|
</select>
|
|
<select id="selectBsProductBomChildInfoById" parameterType="Long" resultMap="BsProductBomChildInfoResult">
|
<include refid="selectBsProductBomChildInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsProductBomChildInfo" parameterType="BsProductBomChildInfo">
|
insert into bs_product_bom_child_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="opCode != null">op_code,</if>
|
<if test="opName != null">op_name,</if>
|
<if test="materialCode != null">material_code,</if>
|
<if test="materialName != null">material_name,</if>
|
<if test="costQty != null and costQty != ''">cost_qty,</if>
|
<if test="unit != null and unit != ''">unit,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="spareField3 != null">spare_field_3,</if>
|
<if test="remark != null">remark,</if>
|
<if test="bomCode != null and bomCode != ''">bom_code,</if>
|
<if test="bomInfoId != null">bom_info_id,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="opCode != null">#{opCode},</if>
|
<if test="opName != null">#{opName},</if>
|
<if test="materialCode != null">#{materialCode},</if>
|
<if test="materialName != null">#{materialName},</if>
|
<if test="costQty != null and costQty != ''">#{costQty},</if>
|
<if test="unit != null and unit != ''">#{unit},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="spareField3 != null">#{spareField3},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="bomCode != null and bomCode != ''">#{bomCode},</if>
|
<if test="bomInfoId != null">#{bomInfoId},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsProductBomChildInfo" parameterType="BsProductBomChildInfo">
|
update bs_product_bom_child_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="opCode != null">op_code = #{opCode},</if>
|
<if test="opName != null">op_name = #{opName},</if>
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
<if test="materialName != null">material_name = #{materialName},</if>
|
<if test="costQty != null and costQty != ''">cost_qty = #{costQty},</if>
|
<if test="unit != null and unit != ''">unit = #{unit},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="spareField3 != null">spare_field_3 = #{spareField3},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if>
|
<if test="bomInfoId != null">bom_info_id = #{bomInfoId},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsProductBomChildInfoById" parameterType="Long">
|
delete from bs_product_bom_child_info where id = #{id}
|
</delete>
|
|
<delete id="deleteBsProductBomChildInfoByIds" parameterType="String">
|
delete from bs_product_bom_child_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|