|
|
|
@ -36,6 +36,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<result property="materialName" column="material_name" />
|
|
|
|
|
<result property="materialSpec" column="material_spec" />
|
|
|
|
|
<result property="barcodeSpec" column="barcode_spec" />
|
|
|
|
|
<result property="productId" column="product_id" />
|
|
|
|
|
<result property="tondBaseId" column="tond_base_id" />
|
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
|
|
<sql id="selectWmsRawOutstockDetailVo">
|
|
|
|
@ -234,16 +236,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
if(wrod.erp_amount is null, 0, wrod.erp_amount) erp_amount,
|
|
|
|
|
wrod.erp_status,
|
|
|
|
|
mpo.price,
|
|
|
|
|
mpo.specification_parameter
|
|
|
|
|
mpo.specification_parameter,
|
|
|
|
|
mpp.product_id,
|
|
|
|
|
mpp.tond_base_id
|
|
|
|
|
from wms_raw_outstock_detail wrod
|
|
|
|
|
left join wms_raw_outstock wro on wrod.raw_outstock_id = wro.raw_outstock_id
|
|
|
|
|
left join mes_base_material_info mbmi on mbmi.material_id = wro.material_id
|
|
|
|
|
left join mes_base_unit_info mbui on mbui.erp_id = mbmi.material_unit_id
|
|
|
|
|
left join mes_product_plan mpp on mpp.plan_code = wro.plan_code
|
|
|
|
|
|
|
|
|
|
left join (select mpp.plan_code,
|
|
|
|
|
mpp.sale_order_id,
|
|
|
|
|
IF(mpp.sale_order_id > 0, mso.material_id, mpp.material_id) product_id,
|
|
|
|
|
mso.tond_base tond_base_id
|
|
|
|
|
from mes_product_plan mpp
|
|
|
|
|
left join mes_sale_order mso on mso.sale_order_id = mpp.sale_order_id) mpp
|
|
|
|
|
on mpp.plan_code = wro.plan_code
|
|
|
|
|
left join mes_base_barcode_info mbbi on wrod.material_barcode = mbbi.barcode_info
|
|
|
|
|
left join mes_purchase_order mpo on mpo.purchase_order_id = mbbi.purchase_order_id
|
|
|
|
|
|
|
|
|
|
<where>
|
|
|
|
|
wrod.outstock_amount > 0
|
|
|
|
|
and wrod.plan_amount >= wrod.outstock_amount
|
|
|
|
@ -254,7 +262,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|
|
|
|
<if test="taskTypeStr != null and taskTypeStr != ''"> and wro.task_type in (${taskTypeStr})</if>
|
|
|
|
|
<if test="taskType != null and taskType != ''"> and wro.task_type = #{taskType}</if>
|
|
|
|
|
</where>
|
|
|
|
|
|
|
|
|
|
</select>
|
|
|
|
|
|
|
|
|
|
</mapper>
|
|
|
|
|