You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
131 lines
7.7 KiB
XML
131 lines
7.7 KiB
XML
|
2 years ago
|
<?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.aucma.base.mapper.OrderBomInfoMapper">
|
||
|
|
|
||
|
|
<resultMap type="OrderBomInfo" id="OrderBomInfoResult">
|
||
|
|
<result property="objId" column="obj_id" />
|
||
|
|
<result property="bomCode" column="bom_code" />
|
||
|
|
<result property="materialCode" column="material_code" />
|
||
|
|
<result property="materialName" column="material_name" />
|
||
|
|
<result property="materialType" column="material_type" />
|
||
|
|
<result property="standardAmount" column="standard_amount" />
|
||
|
|
<result property="parentId" column="parent_id" />
|
||
|
|
<result property="isFlag" column="is_flag" />
|
||
|
|
<result property="createdBy" column="created_by" />
|
||
|
|
<result property="createdTime" column="created_time" />
|
||
|
|
<result property="updatedBy" column="updated_by" />
|
||
|
|
<result property="updatedTime" column="updated_time" />
|
||
|
|
<result property="factoryCode" column="factory_code" />
|
||
|
|
<result property="sort" column="sort" />
|
||
|
|
<result property="vbeln" column="vbeln" />
|
||
|
|
<result property="vbpos" column="vbpos" />
|
||
|
|
</resultMap>
|
||
|
|
|
||
|
|
<sql id="selectOrderBomInfoVo">
|
||
|
|
select obj_id, bom_code, material_code, material_name, material_type, standard_amount, parent_id, is_flag, created_by, created_time, updated_by, updated_time, factory_code, sort, vbeln, vbpos from order_bominfo
|
||
|
|
</sql>
|
||
|
|
|
||
|
|
<select id="selectOrderBomInfoList" parameterType="OrderBomInfo" resultMap="OrderBomInfoResult">
|
||
|
|
<include refid="selectOrderBomInfoVo"/>
|
||
|
|
<where>
|
||
|
|
<if test="bomCode != null and bomCode != ''"> and bom_code = #{bomCode}</if>
|
||
|
|
<if test="materialCode != null and materialCode != ''"> and material_code = #{materialCode}</if>
|
||
|
|
<if test="materialName != null and materialName != ''"> and material_name like concat(concat('%', #{materialName}), '%')</if>
|
||
|
|
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
|
||
|
|
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
|
||
|
|
<if test="parentId != null and parentId != ''"> and parent_id = #{parentId}</if>
|
||
|
|
<if test="isFlag != null "> and is_flag = #{isFlag}</if>
|
||
|
|
<if test="createdBy != null and createdBy != ''"> and created_by = #{createdBy}</if>
|
||
|
|
<if test="createdTime != null "> and created_time = #{createdTime}</if>
|
||
|
|
<if test="updatedBy != null and updatedBy != ''"> and updated_by = #{updatedBy}</if>
|
||
|
|
<if test="updatedTime != null "> and updated_time = #{updatedTime}</if>
|
||
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
||
|
|
<if test="sort != null and sort != ''"> and sort = #{sort}</if>
|
||
|
|
<if test="vbeln != null and vbeln != ''"> and vbeln = #{vbeln}</if>
|
||
|
|
<if test="vbpos != null and vbpos != ''"> and vbpos = #{vbpos}</if>
|
||
|
|
</where>
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<select id="selectOrderBomInfoByObjId" parameterType="Long" resultMap="OrderBomInfoResult">
|
||
|
|
<include refid="selectOrderBomInfoVo"/>
|
||
|
|
where obj_id = #{objId}
|
||
|
|
</select>
|
||
|
|
|
||
|
|
<insert id="insertOrderBomInfo" parameterType="OrderBomInfo">
|
||
|
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||
|
|
SELECT seq_order_bominfo.NEXTVAL as objId FROM DUAL
|
||
|
|
</selectKey>
|
||
|
|
insert into order_bominfo
|
||
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="objId != null">obj_id,</if>
|
||
|
|
<if test="bomCode != null">bom_code,</if>
|
||
|
|
<if test="materialCode != null">material_code,</if>
|
||
|
|
<if test="materialName != null">material_name,</if>
|
||
|
|
<if test="materialType != null">material_type,</if>
|
||
|
|
<if test="standardAmount != null">standard_amount,</if>
|
||
|
|
<if test="parentId != null">parent_id,</if>
|
||
|
|
<if test="isFlag != null">is_flag,</if>
|
||
|
|
<if test="createdBy != null">created_by,</if>
|
||
|
|
<if test="createdTime != null">created_time,</if>
|
||
|
|
<if test="updatedBy != null">updated_by,</if>
|
||
|
|
<if test="updatedTime != null">updated_time,</if>
|
||
|
|
<if test="factoryCode != null">factory_code,</if>
|
||
|
|
<if test="sort != null">sort,</if>
|
||
|
|
<if test="vbeln != null">vbeln,</if>
|
||
|
|
<if test="vbpos != null">vbpos,</if>
|
||
|
|
</trim>
|
||
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||
|
|
<if test="objId != null">#{objId},</if>
|
||
|
|
<if test="bomCode != null">#{bomCode},</if>
|
||
|
|
<if test="materialCode != null">#{materialCode},</if>
|
||
|
|
<if test="materialName != null">#{materialName},</if>
|
||
|
|
<if test="materialType != null">#{materialType},</if>
|
||
|
|
<if test="standardAmount != null">#{standardAmount},</if>
|
||
|
|
<if test="parentId != null">#{parentId},</if>
|
||
|
|
<if test="isFlag != null">#{isFlag},</if>
|
||
|
|
<if test="createdBy != null">#{createdBy},</if>
|
||
|
|
<if test="createdTime != null">#{createdTime},</if>
|
||
|
|
<if test="updatedBy != null">#{updatedBy},</if>
|
||
|
|
<if test="updatedTime != null">#{updatedTime},</if>
|
||
|
|
<if test="factoryCode != null">#{factoryCode},</if>
|
||
|
|
<if test="sort != null">#{sort},</if>
|
||
|
|
<if test="vbeln != null">#{vbeln},</if>
|
||
|
|
<if test="vbpos != null">#{vbpos},</if>
|
||
|
|
</trim>
|
||
|
|
</insert>
|
||
|
|
|
||
|
|
<update id="updateOrderBomInfo" parameterType="OrderBomInfo">
|
||
|
|
update order_bominfo
|
||
|
|
<trim prefix="SET" suffixOverrides=",">
|
||
|
|
<if test="bomCode != null">bom_code = #{bomCode},</if>
|
||
|
|
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||
|
|
<if test="materialName != null">material_name = #{materialName},</if>
|
||
|
|
<if test="materialType != null">material_type = #{materialType},</if>
|
||
|
|
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
|
||
|
|
<if test="parentId != null">parent_id = #{parentId},</if>
|
||
|
|
<if test="isFlag != null">is_flag = #{isFlag},</if>
|
||
|
|
<if test="createdBy != null">created_by = #{createdBy},</if>
|
||
|
|
<if test="createdTime != null">created_time = #{createdTime},</if>
|
||
|
|
<if test="updatedBy != null">updated_by = #{updatedBy},</if>
|
||
|
|
<if test="updatedTime != null">updated_time = #{updatedTime},</if>
|
||
|
|
<if test="factoryCode != null">factory_code = #{factoryCode},</if>
|
||
|
|
<if test="sort != null">sort = #{sort},</if>
|
||
|
|
<if test="vbeln != null">vbeln = #{vbeln},</if>
|
||
|
|
<if test="vbpos != null">vbpos = #{vbpos},</if>
|
||
|
|
</trim>
|
||
|
|
where obj_id = #{objId}
|
||
|
|
</update>
|
||
|
|
|
||
|
|
<delete id="deleteOrderBomInfoByObjId" parameterType="Long">
|
||
|
|
delete from order_bominfo where obj_id = #{objId}
|
||
|
|
</delete>
|
||
|
|
|
||
|
|
<delete id="deleteOrderBomInfoByObjIds" parameterType="String">
|
||
|
|
delete from order_bominfo where obj_id in
|
||
|
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||
|
|
#{objId}
|
||
|
|
</foreach>
|
||
|
|
</delete>
|
||
|
|
</mapper>
|