|
@@ -3,7 +3,7 @@
|
|
|
<mapper namespace="org.jeecg.modules.scas.mapper.DyeLossMapper">
|
|
|
|
|
|
<select id="selectPage" resultType="org.jeecg.modules.scas.entity.DyeLoss" >
|
|
|
- select
|
|
|
+ /*select
|
|
|
d.cinvcode,--物料编码
|
|
|
d.cInvName,--物料名称
|
|
|
b.cfree1 color,--颜色
|
|
@@ -18,9 +18,30 @@
|
|
|
left join OM_MODetails b on b.moid=a.moid
|
|
|
left join Vendor c on c.cVenCode=a.cVenCode
|
|
|
left join Inventory d on b.cInvCode=d.cInvCode
|
|
|
- --left join SO_SODetails e on e.iSOsID =b.iSOsID
|
|
|
+ left join SO_SODetails e on e.iSOsID =b.iSOsID
|
|
|
left join OM_MatSettleVouch f on b.MODetailsID =f.MODetailsID
|
|
|
- left join OM_MatSettleVouchs g on g.msid=f.msid
|
|
|
+ left join OM_MatSettleVouchs g on g.msid=f.msid*/
|
|
|
+
|
|
|
+ select
|
|
|
+ d.cinvcode,--物料编码
|
|
|
+ d.cInvName,--物料名称
|
|
|
+ b.cfree1 color,--颜色
|
|
|
+ cVenName cVenName,--供应商
|
|
|
+ a.cCode cCode,--订单号
|
|
|
+ b.iQuantity,--订单数量
|
|
|
+ ISNULL(iReceivedQTY, 0 ) iQuantity2,--采购入库数
|
|
|
+ ISNULL(iMaterialSendQty, 0 ) iQuantity3,--材料出库数
|
|
|
+ ISNULL((select sum(OM_MatSettleVouchs.iMSQuantity) from OM_MatSettleVouch
|
|
|
+ left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
|
|
|
+ where b.MODetailsID=OM_MatSettleVouch.modetailsid ) ,0)iMSQuantity,--核销数量
|
|
|
+ ISNULL( (1-iReceivedQTY/NULLIF((select sum(OM_MatSettleVouchs.iMSQuantity) from OM_MatSettleVouch
|
|
|
+ left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
|
|
|
+ where b.MODetailsID=OM_MatSettleVouch.modetailsid ),0))*100,0) dyeLossRate--染损
|
|
|
+ from OM_MOMain a
|
|
|
+ left join OM_MODetails b on b.moid=a.moid
|
|
|
+ left join Vendor c on c.cVenCode=a.cVenCode
|
|
|
+ left join Inventory d on b.cInvCode=d.cInvCode
|
|
|
+ --left join SO_SODetails e on e.iSOsID =b.iSOsID
|
|
|
${ew.customSqlSegment}
|
|
|
</select>
|
|
|
|
|
@@ -77,19 +98,21 @@
|
|
|
b.cfree1 color,--颜色
|
|
|
cVenName cVenName,--供应商
|
|
|
a.cCode cCode,--订单号
|
|
|
- b.iQuantity iQuantity,--订单数量
|
|
|
+ b.iQuantity,--订单数量
|
|
|
ISNULL(iReceivedQTY, 0 ) iQuantity2,--采购入库数
|
|
|
ISNULL(iMaterialSendQty, 0 ) iQuantity3,--材料出库数
|
|
|
- ISNULL(g.iMSQuantity, 0 ) iMSQuantity,--核销数量
|
|
|
- ISNULL((1-iReceivedQTY/NULLIF(g.iMSQuantity,0))*100,0) dyeLossRate--染损
|
|
|
+ ISNULL((select sum(OM_MatSettleVouchs.iMSQuantity) from OM_MatSettleVouch
|
|
|
+ left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
|
|
|
+ where b.MODetailsID=OM_MatSettleVouch.modetailsid ) ,0)iMSQuantity,--核销数量
|
|
|
+ ISNULL( (1-iReceivedQTY/NULLIF((select sum(OM_MatSettleVouchs.iMSQuantity) from OM_MatSettleVouch
|
|
|
+ left join OM_MatSettleVouchs on OM_MatSettleVouchs.msid=OM_MatSettleVouch.msid
|
|
|
+ where b.MODetailsID=OM_MatSettleVouch.modetailsid ),0))*100,0) dyeLossRate--染损
|
|
|
from OM_MOMain a
|
|
|
left join OM_MODetails b on b.moid=a.moid
|
|
|
left join Vendor c on c.cVenCode=a.cVenCode
|
|
|
left join Inventory d on b.cInvCode=d.cInvCode
|
|
|
- left join SO_SODetails e on e.iSOsID =b.iSOsID
|
|
|
- left join OM_MatSettleVouch f on b.MODetailsID =f.MODetailsID
|
|
|
- left join OM_MatSettleVouchs g on g.msid=f.msid
|
|
|
- where c.cVCCode='0105' and g.cRdBusType='委外发料'
|
|
|
+ --left join SO_SODetails e on e.iSOsID =b.iSOsID
|
|
|
+ where c.cVCCode='0105'
|
|
|
</select>
|
|
|
|
|
|
|