|
|
|
@ -12,8 +12,10 @@
|
|
|
|
|
<result property="materialType" column="material_type"/>
|
|
|
|
|
<result property="standardAmount" column="standard_amount"/>
|
|
|
|
|
<result property="parentId" column="parent_id"/>
|
|
|
|
|
<result property="parentCode" column="parent_code"/>
|
|
|
|
|
<result property="parentName" column="parent_name"/>
|
|
|
|
|
<result property="factoryCode" column="factory_code"/>
|
|
|
|
|
<result property="factoryName" column="factory_name"/>
|
|
|
|
|
<result property="sort" column="sort"/>
|
|
|
|
|
<result property="vbeln" column="vbeln"/>
|
|
|
|
|
<result property="vbpos" column="vbpos"/>
|
|
|
|
@ -26,56 +28,62 @@
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectProdBomInfoVo">
|
|
|
|
|
select obj_id,
|
|
|
|
|
bom_code,
|
|
|
|
|
material_code,
|
|
|
|
|
material_name,
|
|
|
|
|
material_type,
|
|
|
|
|
standard_amount,
|
|
|
|
|
parent_id,
|
|
|
|
|
parent_name,
|
|
|
|
|
factory_code,
|
|
|
|
|
sort,
|
|
|
|
|
vbeln,
|
|
|
|
|
vbpos,
|
|
|
|
|
ancestors,
|
|
|
|
|
is_flag,
|
|
|
|
|
create_by,
|
|
|
|
|
create_time,
|
|
|
|
|
update_by,
|
|
|
|
|
update_time
|
|
|
|
|
from prod_bom_info
|
|
|
|
|
select pbi.obj_id,
|
|
|
|
|
pbi.bom_code,
|
|
|
|
|
pbi.material_code,
|
|
|
|
|
bmi.material_name,
|
|
|
|
|
pbi.material_type,
|
|
|
|
|
pbi.standard_amount,
|
|
|
|
|
pbi.parent_id,
|
|
|
|
|
pbi2.material_code parent_code,
|
|
|
|
|
pbi2.material_name parent_name,
|
|
|
|
|
bf.factory_code,
|
|
|
|
|
bf.factory_name,
|
|
|
|
|
pbi.sort,
|
|
|
|
|
pbi.vbeln,
|
|
|
|
|
pbi.vbpos,
|
|
|
|
|
pbi.ancestors,
|
|
|
|
|
pbi.is_flag,
|
|
|
|
|
pbi.create_by,
|
|
|
|
|
pbi.create_time,
|
|
|
|
|
pbi.update_by,
|
|
|
|
|
pbi.update_time
|
|
|
|
|
from prod_bom_info pbi
|
|
|
|
|
left join base_material_info bmi on bmi.material_code = pbi.material_code
|
|
|
|
|
left join prod_bom_info pbi2 on pbi.obj_id = pbi2.parent_id
|
|
|
|
|
left join base_product_line bpl on bpl.product_line_code = bmi.product_line_code
|
|
|
|
|
left join base_factory bf on bf.factory_code = bpl.plant_code
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectProdBomInfoList" parameterType="ProdBomInfo" resultMap="ProdBomInfoResult">
|
|
|
|
|
<include refid="selectProdBomInfoVo"/>
|
|
|
|
|
<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('%', #{materialName},
|
|
|
|
|
<if test="bomCode != null and bomCode != ''">and pbi.bom_code = #{bomCode}</if>
|
|
|
|
|
<if test="materialCode != null and materialCode != ''">and pbi.material_code = #{materialCode}</if>
|
|
|
|
|
<if test="materialName != null and materialName != ''">and pbi.material_name like 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="parentName != null and parentName != ''">and parent_name like concat('%', #{parentName}, '%')
|
|
|
|
|
<if test="materialType != null and materialType != ''">and pbi.material_type = #{materialType}</if>
|
|
|
|
|
<if test="standardAmount != null ">and pbi.standard_amount = #{standardAmount}</if>
|
|
|
|
|
<if test="parentId != null and parentId != ''">and pbi.parent_id = #{parentId}</if>
|
|
|
|
|
<if test="parentName != null and parentName != ''">and pbi.parent_name like concat('%', #{parentName}, '%')
|
|
|
|
|
</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>
|
|
|
|
|
<if test="ancestors != null and ancestors != ''">and ancestors = #{ancestors}</if>
|
|
|
|
|
<if test="isFlag != null and isFlag != ''">and is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
|
|
|
|
|
<if test="createTime != null ">and create_time = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
|
|
|
|
|
<if test="updateTime != null ">and update_time = #{updateTime}</if>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''">and pbi.factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="sort != null and sort != ''">and pbi.sort = #{sort}</if>
|
|
|
|
|
<if test="vbeln != null and vbeln != ''">and pbi.vbeln = #{vbeln}</if>
|
|
|
|
|
<if test="vbpos != null and vbpos != ''">and pbi.vbpos = #{vbpos}</if>
|
|
|
|
|
<if test="ancestors != null and ancestors != ''">and pbi.ancestors like concat('%', #{ancestors}, '%')</if>
|
|
|
|
|
<if test="isFlag != null and isFlag != ''">and pbi.is_flag = #{isFlag}</if>
|
|
|
|
|
<if test="createBy != null and createBy != ''">and pbi.create_by = #{createBy}</if>
|
|
|
|
|
<if test="createTime != null ">and pbi.create_time = #{createTime}</if>
|
|
|
|
|
<if test="updateBy != null and updateBy != ''">and pbi.update_by = #{updateBy}</if>
|
|
|
|
|
<if test="updateTime != null ">and pbi.update_time = #{updateTime}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectProdBomInfoByObjId" parameterType="Long" resultMap="ProdBomInfoResult">
|
|
|
|
|
<include refid="selectProdBomInfoVo"/>
|
|
|
|
|
where obj_id = #{objId}
|
|
|
|
|
where pbi.obj_id = #{objId}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<insert id="insertProdBomInfo" parameterType="ProdBomInfo" useGeneratedKeys="true" keyProperty="objId">
|
|
|
|
|