<?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.productBom.mapper.BsProductBomInfoMapper">
|
|
<resultMap type="BsProductBomInfo" id="BsProductBomInfoResult">
|
<result property="id" column="id" />
|
<result property="bomCode" column="bom_code" />
|
<result property="bomName" column="bom_name" />
|
<result property="productCode" column="product_code" />
|
<result property="productName" column="product_name" />
|
<result property="version" column="version" />
|
<result property="status" column="status" />
|
<result property="spareField1" column="spare_field_1" />
|
<result property="spareField2" column="spare_field_2" />
|
<result property="remark" column="remark" />
|
<result property="createUser" column="create_user" />
|
<result property="createTime" column="create_time" />
|
<result property="updateUser" column="update_user" />
|
<result property="updateTime" column="update_time" />
|
<result property="dataSource" column="data_source" />
|
</resultMap>
|
|
<sql id="selectBsProductBomInfoVo">
|
select id, bom_code, bom_name, product_code, product_name, version, status, spare_field_1, spare_field_2, remark, create_user, create_time, update_user, update_time, data_source from bs_product_bom_info
|
</sql>
|
|
<select id="selectBsProductBomInfoList" parameterType="BsProductBomInfo" resultMap="BsProductBomInfoResult">
|
<include refid="selectBsProductBomInfoVo"/>
|
<where>
|
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
|
<if test="bomName != null and bomName != ''"> and bom_name like concat('%', #{bomName}, '%')</if>
|
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
<if test="productName != null and productName != ''"> and product_name like concat('%', #{productName}, '%')</if>
|
<if test="dataSource != null and dataSource != ''"> and data_source = #{dataSource}</if>
|
</where>
|
</select>
|
|
<select id="selectBsProductBomInfoById" parameterType="Long" resultMap="BsProductBomInfoResult">
|
<include refid="selectBsProductBomInfoVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertBsProductBomInfo" parameterType="BsProductBomInfo">
|
insert into bs_product_bom_info
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="id != null">id,</if>
|
<if test="bomCode != null and bomCode != ''">bom_code,</if>
|
<if test="bomName != null">bom_name,</if>
|
<if test="productCode != null and productCode != ''">product_code,</if>
|
<if test="productName != null">product_name,</if>
|
<if test="version != null">version,</if>
|
<if test="status != null and status != ''">status,</if>
|
<if test="spareField1 != null">spare_field_1,</if>
|
<if test="spareField2 != null">spare_field_2,</if>
|
<if test="remark != null">remark,</if>
|
<if test="createUser != null">create_user,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateUser != null">update_user,</if>
|
<if test="updateTime != null">update_time,</if>
|
<if test="dataSource != null">data_source,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="id != null">#{id},</if>
|
<if test="bomCode != null and bomCode != ''">#{bomCode},</if>
|
<if test="bomName != null">#{bomName},</if>
|
<if test="productCode != null and productCode != ''">#{productCode},</if>
|
<if test="productName != null">#{productName},</if>
|
<if test="version != null">#{version},</if>
|
<if test="status != null and status != ''">#{status},</if>
|
<if test="spareField1 != null">#{spareField1},</if>
|
<if test="spareField2 != null">#{spareField2},</if>
|
<if test="remark != null">#{remark},</if>
|
<if test="createUser != null">#{createUser},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateUser != null">#{updateUser},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
<if test="dataSource != null">#{dataSource},</if>
|
</trim>
|
</insert>
|
|
<update id="updateBsProductBomInfo" parameterType="BsProductBomInfo">
|
update bs_product_bom_info
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="bomCode != null and bomCode != ''">bom_code = #{bomCode},</if>
|
<if test="bomName != null">bom_name = #{bomName},</if>
|
<if test="productCode != null and productCode != ''">product_code = #{productCode},</if>
|
<if test="productName != null">product_name = #{productName},</if>
|
<if test="version != null">version = #{version},</if>
|
<if test="status != null and status != ''">status = #{status},</if>
|
<if test="spareField1 != null">spare_field_1 = #{spareField1},</if>
|
<if test="spareField2 != null">spare_field_2 = #{spareField2},</if>
|
<if test="remark != null">remark = #{remark},</if>
|
<if test="createUser != null">create_user = #{createUser},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateUser != null">update_user = #{updateUser},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
<if test="dataSource != null">data_source = #{dataSource},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteBsProductBomInfoById" parameterType="Long">
|
delete from bs_product_bom_info where id = #{id}
|
</delete>
|
|
<delete id="deleteBsProductBomInfoByIds" parameterType="String">
|
delete from bs_product_bom_info where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|