|
|
|
@ -35,8 +35,28 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
select factory_code, production_version, bom_code, optional_bom, optional_bom_text, pvvd, pved, bom_calculate_number, bom_calculate_unit, bom_base_number, bom_base_unit, component_unit, component_pro_flag, msi, sanka, attr1, attr2, attr3, create_by, create_time, update_by, update_time, remark, current_version from base_bom
|
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
|
|
<select id="selectBaseBomList" parameterType="BaseBom" resultType="com.op.wms.domain.BaseBom">
|
|
|
|
|
<select id="selectBaseBomList0" parameterType="BaseBom" resultType="com.op.wms.domain.BaseBom">
|
|
|
|
|
select
|
|
|
|
|
count(bb.bom_bo) AS number,
|
|
|
|
|
bbc.bom_code as bomCode,
|
|
|
|
|
bb.bom_bo as handle,
|
|
|
|
|
b1.product_desc_zh as productDescZh,
|
|
|
|
|
bbc.product_code as productCode
|
|
|
|
|
from base_bom_component bbc
|
|
|
|
|
left join base_product b1 on right(b1.product_code,11) = bbc.product_code
|
|
|
|
|
left join base_bom bb on bb.bom_code = bbc.bom_code
|
|
|
|
|
left join base_product bp on right(bp.product_code,11) = bbc.component
|
|
|
|
|
<where>
|
|
|
|
|
<if test="bomCode != null and bomCode != ''"> and bbc.bom_code like concat('%', #{bomCode}, '%')</if>
|
|
|
|
|
</where>
|
|
|
|
|
GROUP BY bbc.bom_code,bb.bom_bo,b1.product_desc_zh,bbc.product_code
|
|
|
|
|
order by bbc.bom_code desc
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--第一层-->
|
|
|
|
|
<select id="selectBaseBomList1" parameterType="BaseBom" resultType="com.op.wms.domain.BaseBom">
|
|
|
|
|
select
|
|
|
|
|
bbc.handle as handle,
|
|
|
|
|
bb.factory_code as factoryCode,
|
|
|
|
|
bb.production_version as productionVersion,
|
|
|
|
|
bb.bom_code as bomCode,
|
|
|
|
@ -72,13 +92,64 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
bbc.loss_rate as lossRate,
|
|
|
|
|
bbc.loss_amount as lossAmount,
|
|
|
|
|
bbc.cilosses as cilosses
|
|
|
|
|
from base_bom bb
|
|
|
|
|
left join base_bom_component bbc on bb.bom_code = bbc.bom_code
|
|
|
|
|
from base_bom_component bbc
|
|
|
|
|
left join base_product b1 on right(b1.product_code,11) = bbc.product_code
|
|
|
|
|
left join base_product bp on right(bp.product_code,11) = bbc.component
|
|
|
|
|
left join base_bom bb on bbc.bom_code = bb.bom_code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="factoryCode != null and factoryCode != ''"> and factory_code = #{factoryCode}</if>
|
|
|
|
|
<if test="bomCode != null and bomCode != ''"> and bb.bom_code like concat('%', #{bomCode}, '%')</if>
|
|
|
|
|
<if test="bomCode != null and bomCode != ''"> and bbc.bom_code like concat('%', #{bomCode}, '%')</if>
|
|
|
|
|
<if test="bomHierarchy != null and bomHierarchy != ''"> and bbc.bom_hierarchy = #{bomHierarchy}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<!--第二层以及以上-->
|
|
|
|
|
<select id="selectBaseBomList2" parameterType="BaseBom" resultType="com.op.wms.domain.BaseBom">
|
|
|
|
|
select
|
|
|
|
|
bbc.handle as handle,
|
|
|
|
|
bb.factory_code as factoryCode,
|
|
|
|
|
bb.production_version as productionVersion,
|
|
|
|
|
bb.bom_code as bomCode,
|
|
|
|
|
bb.optional_bom as optionalBom,
|
|
|
|
|
bb.optional_bom_text as optionalBomText,
|
|
|
|
|
bb.pvvd as pvvd,
|
|
|
|
|
bb.pved as pved,
|
|
|
|
|
bb.bom_calculate_number as bomCalculateNumber,
|
|
|
|
|
bb.bom_calculate_unit as bomCalculateUnit,
|
|
|
|
|
bb.bom_base_number as bomBaseNumber,
|
|
|
|
|
bb.bom_base_unit as bomBaseUnit,
|
|
|
|
|
bb.component_unit as componentUnit,
|
|
|
|
|
bb.component_pro_flag as componentProFlag,
|
|
|
|
|
bb.msi as msi,
|
|
|
|
|
bb.sanka as sanka,
|
|
|
|
|
bb.attr1 as attr1,
|
|
|
|
|
bb.attr2 as attr2,
|
|
|
|
|
bb.attr3 as attr3,
|
|
|
|
|
bb.create_by as createBy,
|
|
|
|
|
bb.create_time as createTime,
|
|
|
|
|
bb.update_by as updateBy,
|
|
|
|
|
bb.update_time,
|
|
|
|
|
bb.remark as remark,
|
|
|
|
|
bb.current_version as currentVersion,
|
|
|
|
|
bbc.product_code as productCode,
|
|
|
|
|
b1.product_desc_zh as productDescZh,
|
|
|
|
|
bp.product_desc_zh as componentDescZh,
|
|
|
|
|
bbc.cumc as cumc,
|
|
|
|
|
bbc.component as component,
|
|
|
|
|
bbc.bom_hierarchy as bomHierarchy,
|
|
|
|
|
bbc.project_no as projectNo,
|
|
|
|
|
bbc.standard_dosage as standardDosage,
|
|
|
|
|
bbc.loss_rate as lossRate,
|
|
|
|
|
bbc.loss_amount as lossAmount,
|
|
|
|
|
bbc.cilosses as cilosses
|
|
|
|
|
from base_bom_component bbc
|
|
|
|
|
left join base_product b1 on right(b1.product_code,11) = bbc.product_code
|
|
|
|
|
left join base_product bp on right(bp.product_code,11) = bbc.component
|
|
|
|
|
left join base_bom bb on bbc.bom_code = bb.bom_code
|
|
|
|
|
<where>
|
|
|
|
|
<if test="bomCode != null and bomCode != ''"> and bbc.bom_code like concat('%', #{bomCode}, '%')</if>
|
|
|
|
|
and bbc.cumc = #{component}
|
|
|
|
|
<if test="handle != null and handle != ''"> and bbc.handle = #{handle}</if>
|
|
|
|
|
<if test="bomHierarchy != null and bomHierarchy != ''"> and bbc.bom_hierarchy = #{bomHierarchy}</if>
|
|
|
|
|
</where>
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
@ -183,4 +254,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
#{factoryCode}
|
|
|
|
|
</foreach>
|
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
|
|
<select id="selectLevels" parameterType="String" resultType="String">
|
|
|
|
|
select max( bom_hierarchy ) AS levels
|
|
|
|
|
from base_bom_component
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
<select id="selectChildNodes" parameterType="com.op.wms.domain.BaseBom" resultType="Integer">
|
|
|
|
|
select count(*) as number
|
|
|
|
|
from base_bom_component
|
|
|
|
|
where cumc = #{component}
|
|
|
|
|
and bom_code = #{bomCode}
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|