|
@@ -4,7 +4,7 @@
|
|
|
|
|
|
<!-- 获取 头信息 主要是成衣委外及源头订单信息 -->
|
|
|
<select id="getFabricLossData" resultType="org.jeecg.modules.report.entity.FabricLoss">
|
|
|
- select distinct * from VIEW_FabricLoss_Head_Clothes where cCode like CONCAT('%',#{code},'%')
|
|
|
+ select distinct * from VIEW_FabricLoss_Head_Clothes where (cCode like CONCAT('%',#{code},'%') and cCode not like '%样%')
|
|
|
</select>
|
|
|
<!-- 获取计划员 103的面料委外制单人,供应商分类是染厂的 -->
|
|
|
<select id="getPlanner" resultType="java.lang.String">
|
|
@@ -14,7 +14,7 @@
|
|
|
(y.cInvCCode like '01%' or y.cInvCCode like '02%' or y.cInvCCode like '03%' or y.cInvCCode like '04%') )
|
|
|
and
|
|
|
exists (select x.cVenCode from Vendor x where x.cVenCode=om_momain.cVenCode and x.cVCCode='0105')
|
|
|
- and cCode like CONCAT(#{code},'%')
|
|
|
+ and (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
|
|
|
</select>
|
|
|
<!-- 制单人 103的委外发票制单人 -->
|
|
|
<!--
|
|
@@ -33,12 +33,12 @@
|
|
|
<!-- 排单数量 -->
|
|
|
<select id="getNumber" resultType="java.lang.String">
|
|
|
select sum(isnull(iQuantity,0))as 'iQuantity' from VIEW_OM_MOMain_ALL_Clothes
|
|
|
- where cCode like CONCAT(#{code},'%')
|
|
|
+ where (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
|
|
|
</select>
|
|
|
<!-- 销售出库数量 -->
|
|
|
<select id="getSaleOutSum" resultType="java.lang.String">
|
|
|
select isnull(sum(iQuantity),0) as 'iQuantity' from VIEW_FabricLoss_Head_Clothes_SaleOut_Sum where
|
|
|
- cCode like CONCAT(#{code},'%')
|
|
|
+ (cCode like CONCAT(#{code},'%') and cCode not like '%样%')
|
|
|
</select>
|
|
|
<!--
|
|
|
<select id="getPrice" resultType="java.lang.String">
|
|
@@ -76,217 +76,13 @@
|
|
|
inner join Inventory c on b.cInvCode=c.cInvCode
|
|
|
inner join Vendor d on a.cVenCode=d.cVenCode
|
|
|
inner join VendorClass e on d.cVCCode =e.cVCCode
|
|
|
- where a.cPOID like CONCAT(#{code},'%')
|
|
|
+ where (a.cPOID like CONCAT(#{code},'%') and a.cPOID not like '%样%')
|
|
|
and (c.cInvCCode LIKE '01%'
|
|
|
or c.cInvCCode LIKE '02%'
|
|
|
or c.cInvCCode LIKE '03%'
|
|
|
or c.cInvCCode LIKE '04%') and c.cInvCCode not in ('0299','0399','0499')
|
|
|
) as t1 group by cVCName,cVenName,cVenAbbName,cPOID,cInvCode,cInvName,cColor
|
|
|
</select>
|
|
|
- <!-- 其他入库纱,找委外订单的材料出库单,获取物料号+批号,物料号+批号再其他入库单 -->
|
|
|
- <!--
|
|
|
- <select id="getPurchaseListOtherInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
|
|
|
- (
|
|
|
- SELECT
|
|
|
- a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,
|
|
|
- isnull(isnull(stuff((SELECT ',' + x.cdefine9 FROM rdrecord08 x
|
|
|
- inner join RdRecords08 y on x.id=y.id
|
|
|
- where y.cInvCode + isnull( y.cFree1, '' ) + isnull( y.cBatch, '' )=
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) FOR XML path('') ), 1, 1, ''),cBatch),'') as cPlanCode,g.cVenAbbName
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
- INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
|
|
|
- inner join om_momain f on f.moid = e.moid
|
|
|
- inner join vendor g on f.cVenCode=g.cVenCode
|
|
|
- WHERE
|
|
|
- (a.cbatch is null or a.cbatch='' or a.cbatch <> '期初') and
|
|
|
- (d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
|
|
|
- a.comcode LIKE CONCAT(#{code},'%') and
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
|
|
|
- SELECT
|
|
|
- b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
|
|
|
- FROM
|
|
|
- RdRecords08 b
|
|
|
- INNER JOIN rdrecord08 a ON a.id = b.ID
|
|
|
- WHERE
|
|
|
- a.cbustype = '其他入库'
|
|
|
- ) and
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
|
|
|
- SELECT
|
|
|
- u.cInvCode + isnull( u.cFree1, '' ) + isnull( u.cBatch, '' )
|
|
|
- FROM
|
|
|
- rdrecords01 u
|
|
|
- inner join RdRecord01 v on u.id=v.id
|
|
|
- inner join OM_MODetails w on u.iOMoDID =w.MODetailsID
|
|
|
- inner join om_momain x on w.moid =x.moid
|
|
|
- where x.cCode like CONCAT(#{code},'%')
|
|
|
- ) and
|
|
|
- d.cinvname <> '杂纱' and a.iquantity>0
|
|
|
- ) union all (
|
|
|
- SELECT
|
|
|
- a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,
|
|
|
- isnull(isnull(stuff((SELECT ',' + x.cdefine9 FROM rdrecord08 x
|
|
|
- inner join RdRecords08 y on x.id=y.id
|
|
|
- where y.cInvCode + isnull( y.cFree1, '' ) + isnull( y.cBatch, '' ) in (
|
|
|
- select cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'')=a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' )
|
|
|
- ) FOR XML path('') ), 1, 1, ''),cBatch),'') as cPlanCode,g.cVenAbbName
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
- INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
|
|
|
- inner join om_momain f on f.moid = e.moid
|
|
|
- inner join vendor g on f.cVenCode=g.cVenCode
|
|
|
- WHERE
|
|
|
- (a.cbatch is null or a.cbatch='' or a.cbatch <> '期初') and
|
|
|
- (d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
|
|
|
- a.comcode LIKE CONCAT(#{code},'%') and
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) IN (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
|
|
|
- FROM
|
|
|
- RdRecords08 b
|
|
|
- INNER JOIN rdrecord08 a ON a.id = b.ID
|
|
|
- WHERE
|
|
|
- a.cbustype in ('其他入库','转换入库')
|
|
|
- )
|
|
|
- ) and
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
|
|
|
- SELECT
|
|
|
- b.cInvCode + isnull( b.cFree1, '' ) + isnull( b.cBatch, '' )
|
|
|
- FROM
|
|
|
- RdRecords08 b
|
|
|
- INNER JOIN rdrecord08 a ON a.id = b.ID
|
|
|
- WHERE
|
|
|
- a.cbustype = '其他入库'
|
|
|
- ) and
|
|
|
- a.cInvCode + isnull( a.cFree1, '' ) + isnull( a.cBatch, '' ) not IN (
|
|
|
- SELECT
|
|
|
- u.cInvCode + isnull( u.cFree1, '' ) + isnull( u.cBatch, '' )
|
|
|
- FROM
|
|
|
- rdrecords01 u
|
|
|
- inner join RdRecord01 v on u.id=v.id
|
|
|
- inner join OM_MODetails w on u.iOMoDID =w.MODetailsID
|
|
|
- inner join om_momain x on w.moid =x.moid
|
|
|
- where x.cCode like CONCAT(#{code},'%')
|
|
|
- ) and
|
|
|
- d.cinvname <> '杂纱' and a.iquantity>0
|
|
|
- ) union all (
|
|
|
- SELECT
|
|
|
- a.comcode as cCode,isnull(a.iSQuantity,a.iquantity) as iQuantity,isnull(a.iUnitCost,0) as iPrice,
|
|
|
- isnull(a.cBatch,'') as cBatch,d.cInvName,a.cInvCode,isnull(a.cFree1,'') as cColor,'杂纱' as cPlanCode,g.cVenAbbName
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
- INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
|
|
|
- inner join om_momain f on f.moid = e.moid
|
|
|
- inner join vendor g on f.cVenCode=g.cVenCode
|
|
|
- WHERE
|
|
|
- (a.cbatch is null or a.cbatch='' or a.cbatch <> '期初') and
|
|
|
- (d.cInvCCode LIKE '01%' or d.cInvCCode LIKE '02%' or d.cInvCCode LIKE '03%' or d.cInvCCode LIKE '04%') and
|
|
|
- a.comcode LIKE CONCAT(#{code},'%') and
|
|
|
- d.cinvname='杂纱' and a.iquantity>0
|
|
|
- )
|
|
|
- </select>-->
|
|
|
- <!-- 来源余纱,找委外订单的材料出库单,获取物料号+批号。如果物料号+批号在形态转换单中,取转换前物料+批号。判断物料+批号,是否在其他采购入库里 -->
|
|
|
- <!--
|
|
|
- <select id="getPurchaseListOtherPurInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
|
|
|
-
|
|
|
- (
|
|
|
- SELECT
|
|
|
- a.autoid,a.comcode as cCode,case when a.iSQuantity is null or a.iSQuantity=0 then a.iquantity else a.iSQuantity end as iQuantity,
|
|
|
- isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,a.cInvCode,isnull(a.cFree1,'') as cColor,d.cInvName,
|
|
|
- case when a.cBatch is not null and a.cBatch='期初' then '期初'
|
|
|
- else
|
|
|
- isnull(stuff((
|
|
|
- select ','+x.cPOID from RdRecords01 u
|
|
|
- inner join RdRecord01 v on u.id=v.id
|
|
|
- inner join PO_Podetails w on u.iPOsID =w.ID
|
|
|
- inner join PO_Pomain x on w.POID =x.POID
|
|
|
- where x.cPOID not like CONCAT(#{code},'%') and v.cbustype='普通采购' and
|
|
|
- u.cinvcode+isnull(u.cfree1,'')+isnull(u.cbatch,'') = a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'')
|
|
|
- FOR XML path('')
|
|
|
- ), 1, 1, ''),'')
|
|
|
- end as cPlanCode,g.cVenAbbName
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
- INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
|
|
|
- inner join om_momain f on f.moid = e.moid
|
|
|
- inner join vendor g on f.cVenCode=g.cVenCode
|
|
|
- WHERE
|
|
|
- (d.cInvCCode LIKE '01%'
|
|
|
- or d.cInvCCode LIKE '02%'
|
|
|
- or d.cInvCCode LIKE '03%'
|
|
|
- or d.cInvCCode LIKE '04%') and
|
|
|
- a.comcode LIKE CONCAT(#{code},'%') and
|
|
|
- d.cInvName <> '杂纱' and
|
|
|
- a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
|
- ) and
|
|
|
- a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') not in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
|
- ) and a.iQuantity<>0
|
|
|
- ) union all (
|
|
|
- SELECT
|
|
|
- a.autoid,a.comcode as cCode,case when a.iSQuantity is null or a.iSQuantity=0 then a.iquantity else a.iSQuantity end as iQuantity,
|
|
|
- isnull(a.iUnitCost,0) as iPrice,isnull(a.cBatch,'') as cBatch,a.cInvCode,isnull(a.cFree1,'') as cColor,d.cInvName,
|
|
|
- case when a.cBatch is not null and a.cBatch='期初' then '期初'
|
|
|
- else
|
|
|
- isnull(stuff((
|
|
|
- select ','+x.cPOID from RdRecords01 u
|
|
|
- inner join RdRecord01 v on u.id=v.id
|
|
|
- inner join PO_Podetails w on u.iPOsID =w.ID
|
|
|
- inner join PO_Pomain x on w.POID =x.POID
|
|
|
- where x.cPOID not like CONCAT(#{code},'%') and v.cbustype='普通采购' and
|
|
|
- u.cinvcode+isnull(u.cfree1,'')+isnull(u.cbatch,'') in (
|
|
|
- select cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'')=a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'')
|
|
|
- )
|
|
|
-
|
|
|
- FOR XML path('')
|
|
|
- ), 1, 1, ''),'')
|
|
|
- end as cPlanCode,g.cVenAbbName
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory d ON a.cinvcode = d.cinvcode
|
|
|
- INNER JOIN OM_MODetails e on a.iOMoDID=e.MODetailsID
|
|
|
- inner join om_momain f on f.moid = e.moid
|
|
|
- inner join vendor g on f.cVenCode=g.cVenCode
|
|
|
- WHERE
|
|
|
- (d.cInvCCode LIKE '01%'
|
|
|
- or d.cInvCCode LIKE '02%'
|
|
|
- or d.cInvCCode LIKE '03%'
|
|
|
- or d.cInvCCode LIKE '04%') and
|
|
|
- a.comcode LIKE CONCAT(#{code},'%') and
|
|
|
- d.cInvName <> '杂纱' and
|
|
|
- a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID not like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
|
- and cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') not in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
|
- ) and a.iQuantity<>0
|
|
|
- )
|
|
|
- </select>-->
|
|
|
<!--获取所有委外订单 cComUnitCode : 计量单位,02(PCS)根,04(M)米-->
|
|
|
<select id="getOmOrderListAll" resultType="org.jeecg.modules.report.entity.FabricOMOrder">
|
|
|
select MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber,
|
|
@@ -305,7 +101,7 @@
|
|
|
inner join VendorClass e on d.cVCCode =e.cVCCode
|
|
|
WHERE
|
|
|
c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
|
|
|
) union all (
|
|
|
SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
|
|
|
isnull(b.cFree1,'') as cColor,
|
|
@@ -323,31 +119,13 @@
|
|
|
inner join Inventory h on h.cinvcode=g.cinvcode
|
|
|
WHERE
|
|
|
c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%') and g.cMoCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND (a.cCode LIKE CONCAT(#{code},'%') and g.cMoCode LIKE CONCAT(#{code},'%')
|
|
|
+ and a.cCode not like '%样%' and g.cMoCode not like '%样%')
|
|
|
)) as t1
|
|
|
group by MODetailsID,cVCName,cVenName,cVenAbbName,cVenCode,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
|
|
|
having (sum(iQuantityOut)>0 or sum(iQuantityIn)>0)
|
|
|
order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber
|
|
|
-<!--
|
|
|
- select * from (
|
|
|
- SELECT b.MODetailsID,e.cVCName,d.cVenName ,d.cVenAbbName ,a.cVenCode ,c.cInvCode,c.cInvName,c.cComUnitCode,
|
|
|
- isnull(b.cFree1,'') as cColor,
|
|
|
- isnull((select sum(x.iQuantity-x.iSQuantity+isnull(y.iQuantity,0)) from rdrecords11 x
|
|
|
- left join VIEW_OM_OUT_SETTLEVOUCE y on x.autoid=y.iRdsID
|
|
|
- where y.cmocode like CONCAT(#{code},'%') and x.iOMoDID=b.MODetailsID),0) as iQuantityOut,
|
|
|
- isnull((select sum(iQuantity) from RdRecords01 x where x.iOMoDID=b.MODetailsID),0) as iQuantityIn,
|
|
|
- b.iQuantity,isnull(b.cdefine30,'') as cColorNumber
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join Vendor d on a.cVenCode=d.cVenCode
|
|
|
- inner join VendorClass e on d.cVCCode =e.cVCCode
|
|
|
- WHERE
|
|
|
- c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
- ) as t1 where (iQuantityOut>0 or iQuantityIn>0)
|
|
|
- order by cVCName,cVenName,cInvCode,cInvName,cComUnitCode,cColor,cColorNumber-->
|
|
|
+
|
|
|
|
|
|
</select>
|
|
|
<!--获取销售出库委外订单行id-->
|
|
@@ -362,68 +140,12 @@
|
|
|
inner join VendorClass e on d.cVCCode =e.cVCCode
|
|
|
WHERE
|
|
|
c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND (a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%')
|
|
|
and b.cInvCode+isnull(b.cFree1,'') in (
|
|
|
- select cInvCode+isnull(cFree1,'') from rdrecords32 where cbatch like CONCAT(#{code},'%')
|
|
|
+ select cInvCode+isnull(cFree1,'') from rdrecords32 where (cbatch like CONCAT(#{code},'%') and cbatch not like '%样%')
|
|
|
)
|
|
|
|
|
|
</select>
|
|
|
- <!--获取本次采购入库的委外材料出库单,已核销的取核销数量-->
|
|
|
- <!--
|
|
|
- <select id="getOmOutList" resultType="map">
|
|
|
- SELECT
|
|
|
- g.cVenName,
|
|
|
- g.cVenAbbName,
|
|
|
- e.cCode,
|
|
|
- b.cInvName,
|
|
|
- isnull( a.cFree1, '' ) AS cColor,
|
|
|
- b.cInvCode,
|
|
|
- isnull( a.iSQuantity, a.iQuantity ) AS iQuantity,
|
|
|
- a.autoid,
|
|
|
- a.iPrice,
|
|
|
- a.cBatch
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
|
|
|
- INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
|
|
|
- INNER JOIN om_momain e ON e.moid = d.moid
|
|
|
- INNER JOIN vendor g ON e.cVenCode = g.cVenCode
|
|
|
- WHERE
|
|
|
- b.cInvCCode NOT LIKE '19%'
|
|
|
- AND e.cCode LIKE CONCAT(#{code},'%')
|
|
|
- and (
|
|
|
- a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购'
|
|
|
- )
|
|
|
- or a.cInvCode+isnull(a.cFree1,'')+isnull(a.cbatch,'') in (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join RdRecord01 a on a.id=b.id
|
|
|
- inner join PO_Podetails c on b.iPOsID =c.ID
|
|
|
- inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%') and a.cbustype='普通采购')
|
|
|
- )
|
|
|
- )
|
|
|
-
|
|
|
- </select>-->
|
|
|
- <!--获取本次采购入库的形态转换-->
|
|
|
- <!--
|
|
|
- <select id="getAssemVouchList" resultType="map">
|
|
|
-
|
|
|
- select * from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cAVBatch,'')+isnull(cColor,'') in (
|
|
|
- select cInvCode+isnull(cBatch,'')+isnull(cFree1,'') from RdRecords01
|
|
|
- where iposid in (
|
|
|
- select b.id from PO_Pomain a inner join PO_Podetails b on a.POID =b.POID
|
|
|
- and a.cPOID like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- )
|
|
|
- </select>-->
|
|
|
<!--获取本次采购入库单,含发票和结算数据-->
|
|
|
<select id="getPurchaseInList" resultType="org.jeecg.modules.report.entity.FabricPoOrderIn">
|
|
|
select a.cCode,a.cBusType,b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity,e.cInvName,
|
|
@@ -438,46 +160,13 @@
|
|
|
inner join Inventory e on b.cinvcode=e.cinvcode
|
|
|
inner join Vendor f on f.cVenCode=a.cVenCode
|
|
|
inner join VendorClass g on g.cVCCode =f.cVCCode
|
|
|
- where d.cPOID like CONCAT(#{code},'%')
|
|
|
+ where (d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%')
|
|
|
</select>
|
|
|
<!--获取费用支出-->
|
|
|
<select id="getExpensesList" resultType="org.jeecg.modules.report.entity.FabricExpenses">
|
|
|
select * from VIEW_FabricLoss_Expenses
|
|
|
- where cSOCode like CONCAT(#{code},'%')
|
|
|
+ where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
|
|
|
</select>
|
|
|
- <!--获取采购入库价格列表-->
|
|
|
- <!--<select id="getPurchuseInPriceList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
|
|
|
- select distinct '普通采购' as cBusType,e.cVCName,d.cVenName ,d.cVenAbbName,c.cInvCode,isnull(c.cFree1,'') as cColor,
|
|
|
- isnull(c.cBatch,'') as cBatch
|
|
|
- from PO_Pomain a
|
|
|
- inner join PO_Podetails b on a.poid=b.poid
|
|
|
- inner join Vendor d on a.cVenCode=d.cVenCode
|
|
|
- inner join VendorClass e on d.cVCCode =e.cVCCode
|
|
|
- inner join RdRecords01 c on c.iposid=b.id
|
|
|
- inner join Inventory f on c.cinvcode=f.cinvcode
|
|
|
- where a.cPOID like CONCAT(#{code},'%') and e.cVCName not like '成衣厂'
|
|
|
- and (f.cInvCCode in ('0201','0301','0401') or f.cInvCCode like '01%')
|
|
|
- </select>-->
|
|
|
- <!--获取委外订单发票金额-->
|
|
|
- <!--<select id="getOmInvoiceMoneyList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
|
|
|
-
|
|
|
- select a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName,isnull(sum(c.iSum),0) as iMoney
|
|
|
- from RdRecord01 a
|
|
|
- inner join RdRecords01 b on a.id=b.id
|
|
|
- inner join PurBillVouchs c on c.RdsId=b.autoid
|
|
|
- inner join OM_MODetails d on d.MODetailsID=b.iOMoDID
|
|
|
- inner join om_momain e on d.moid = e.moid
|
|
|
- inner join Vendor f on f.cVenCode=e.cVenCode
|
|
|
- inner join VendorClass g on g.cVCCode =f.cVCCode
|
|
|
- inner join Inventory h on b.cinvcode=h.cinvcode
|
|
|
- where a.cbustype='委外加工'
|
|
|
- and e.cCode like CONCAT(#{code},'%')
|
|
|
- and g.cVCName not like '成衣厂'
|
|
|
- and (h.cInvCCode IN ('0201','0301','0401','0299','0399','0499') OR h.cInvCCode like '01%')
|
|
|
- and b.cInvCode <> 'N3000002426'
|
|
|
- group by a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName
|
|
|
- order by a.cBusType,g.cVCName,f.cVenName ,f.cVenAbbName
|
|
|
- </select>-->
|
|
|
<!--获取委外订单运费发票金额-->
|
|
|
<select id="getOmInvoiceMoneyYfList" resultType="org.jeecg.modules.report.entity.FabricCostInvoice">
|
|
|
select '运费发票' as cBusType,g.cVCName,f.cVenName ,f.cVenAbbName,isnull(sum(d.iSum),0) as iMoney
|
|
@@ -486,7 +175,7 @@
|
|
|
inner join PurBillVouch e on d.PBVID =e.PBVID
|
|
|
inner join Vendor f on f.cVenCode=e.cVenCode
|
|
|
inner join VendorClass g on g.cVCCode =f.cVCCode
|
|
|
- where e.cdefine2 like CONCAT(#{code},'%')
|
|
|
+ where (e.cdefine2 like CONCAT(#{code},'%') and e.cdefine2 not like '%样%')
|
|
|
and d.cInvCode='N3000002426'
|
|
|
and g.cVCName not like '成衣厂'
|
|
|
group by g.cVCName,f.cVenName ,f.cVenAbbName
|
|
@@ -500,7 +189,7 @@
|
|
|
select cPBVCode,cVenName,cVenAbbName,cShipTime,isnull(sum(iSum),0) as iSum,
|
|
|
isnull(sum(iOriSum),0) as iOriSum,isnull(sum(iQuantity),0) as iQuantity,
|
|
|
isnull(sum(iPBVQuantity),0) as iPBVQuantity,isnull(sum(iSQuantity),0) as iSQuantity
|
|
|
- from VIEW_FabricLoss_Cost_Clothes where cCode like CONCAT(#{code},'%')
|
|
|
+ from VIEW_FabricLoss_Cost_Clothes where cCode like CONCAT(#{code},'%') and cCode not like '%样%'
|
|
|
group by
|
|
|
cPBVCode,cVenName,cVenAbbName,cShipTime
|
|
|
order by cPBVCode,cVenName,cVenAbbName,cShipTime
|
|
@@ -508,7 +197,7 @@
|
|
|
<!--开票成本-辅料-->
|
|
|
<select id="getCostAssistList" resultType="org.jeecg.modules.report.entity.FabricCostAssist">
|
|
|
|
|
|
- select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%')
|
|
|
+ select * from VIEW_FabricLoss_Cost_Assist where cPoid like CONCAT(#{code},'%') and cPoid not like '%样%'
|
|
|
and cVenAbbName not in ('宁波森语','马菲羊','森语集团')
|
|
|
order by cAccount,cPoid,cVenAbbName,cInvName,cComUnitName
|
|
|
</select>
|
|
@@ -516,81 +205,10 @@
|
|
|
<select id="getCostClothList" resultType="org.jeecg.modules.report.entity.FabricCostCloth">
|
|
|
|
|
|
select cVenName,cSOCode,cSBVCode,cShipTime,cInvName,isnull(iPrice,0) as iPrice,isnull(sum(iQuantity),0) as iQuantity,isnull(sum(iNatSum),0) as iNatSum
|
|
|
- from VIEW_FabricLoss_Cost_Cloth where cSOCode like CONCAT(#{code},'%')
|
|
|
+ from VIEW_FabricLoss_Cost_Cloth where cSOCode like CONCAT(#{code},'%') and cSOCode not like '%样%'
|
|
|
group by cVenName,cSOCode,cSBVCode,cShipTime,cInvName,iPrice
|
|
|
order by cVenName,cSBVCode,cInvName
|
|
|
</select>
|
|
|
- <!--获取委外入库物料被其他委外订单使用的金额 -->
|
|
|
- <!--
|
|
|
- <select id="getOmInToOtherMoney" resultType="java.lang.String">
|
|
|
- select isnull(sum(b.iprice),0) as iPrice from rdrecords11 b
|
|
|
- inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
|
|
|
- inner join om_momain d on c.MOID =d.MOID
|
|
|
- where (b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'')
|
|
|
- in
|
|
|
- (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
|
|
|
- inner join om_momain d on c.MOID =d.MOID
|
|
|
- where d.ccode like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- or b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') in (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
|
|
|
- inner join om_momain d on c.MOID =d.MOID
|
|
|
- where d.ccode like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- )
|
|
|
- )
|
|
|
- and d.ccode not like CONCAT(#{code},'%')
|
|
|
- </select>-->
|
|
|
- <!--获取使用其他委外入库物料的金额 -->
|
|
|
- <!--
|
|
|
- <select id="getOmOtherToCurMoney" resultType="java.lang.String">
|
|
|
-
|
|
|
- SELECT
|
|
|
- isnull(sum(a.iprice),0) as iPrice
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
|
|
|
- INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
|
|
|
- INNER JOIN om_momain e ON e.moid = d.moid
|
|
|
- WHERE
|
|
|
- b.cInvCCode NOT LIKE '19%'
|
|
|
- AND e.cCode LIKE CONCAT(#{code},'%')
|
|
|
- and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
|
|
|
- inner join om_momain d on c.MOID =d.MOID
|
|
|
- where d.ccode like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join PO_Podetails c on b.iposid=c.id
|
|
|
- inner join PO_Pomain d on d.poid=c.poid
|
|
|
- where d.cPOID like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join OM_MODetails c on b.iOMoDID=c.MODetailsID
|
|
|
- inner join om_momain d on c.MOID =d.MOID
|
|
|
- where d.ccode like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- )
|
|
|
- and a.cinvcode+isnull(a.cfree1,'')+isnull(a.cbatch,'') not in (
|
|
|
- select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
|
- cInvCode+isnull(cColor,'')+isnull(cAVBatch,'') in (
|
|
|
- select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
- inner join PO_Podetails c on b.iposid=c.id
|
|
|
- inner join PO_Pomain d on d.poid=c.poid
|
|
|
- where d.cPOID like CONCAT(#{code},'%')
|
|
|
- )
|
|
|
- )
|
|
|
- </select>-->
|
|
|
<!--获取采购入库物料被其他委外订单使用明细 -->
|
|
|
<select id="getPoOrderInToOther" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
|
|
|
select cCode,cInvCode,cColor,
|
|
@@ -599,12 +217,12 @@
|
|
|
(
|
|
|
select cInvCode,isnull(cFree1,'') as cColor,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,iUnitCost as iPrice
|
|
|
from rdrecords11 where
|
|
|
- comcode not like CONCAT(#{code},'%')
|
|
|
+ comcode not like CONCAT(#{code},'%') and comcode not like '%样%'
|
|
|
and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
|
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
inner join PO_Podetails c on b.iposid=c.id
|
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%')
|
|
|
+ where d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%'
|
|
|
)
|
|
|
or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
|
|
|
select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
@@ -612,48 +230,26 @@
|
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
inner join PO_Podetails c on b.iposid=c.id
|
|
|
inner join PO_Pomain d on c.POID =d.POID
|
|
|
- where d.cPOID like CONCAT(#{code},'%')
|
|
|
+ where d.cPOID like CONCAT(#{code},'%') and d.cPOID not like '%样%'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
|
) as t1
|
|
|
group by cCode,cInvCode,cColor
|
|
|
</select>
|
|
|
- <!--委外订单-材料出库详情-->
|
|
|
- <!--
|
|
|
- <select id="getOmOutDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
|
|
|
- select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
|
|
|
- x.cInvCode as cInvCodeIn,y.cInvName as cInvNameIn,x.cFree1 as cColorIn,x.cBatch as cBatchIn,
|
|
|
- d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,d.cFree1 as cColorOut,d.cBatch as cBatchOut,
|
|
|
- x.iProcessFee/x.iQuantity as iProcessPrice, d.iQuantity/x.iQuantity as iRate,
|
|
|
- d.iQuantity as iQuantityOut,x.iQuantity as iQuantityIn,
|
|
|
- isnull((select sum(iSum)/sum(iPBVQuantity ) from PurBillVouchs x where x.RdsId =e.autoid and f.cbustype='普通采购'),0) as iPurchusePrice
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join RdRecords01 x on x.iOMoDID=b.MODetailsID
|
|
|
- INNER JOIN Inventory y ON x.cinvcode = y.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
|
|
|
- left join rdrecords01 e on d.cInvCode=e.cInvCode
|
|
|
- and isnull(d.cFree1,'')=isnull(e.cFree1,'') and isnull(d.cBatch,'')=isnull(e.cBatch,'')
|
|
|
- left join rdrecord01 f on e.id=f.id
|
|
|
- left join Vendor g on g.cVenCode=f.cVenCode
|
|
|
- WHERE
|
|
|
- c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
-
|
|
|
- </select>-->
|
|
|
<!--委外订单-采购入库详情-->
|
|
|
<select id="getOmInDetailList" resultType="org.jeecg.modules.report.entity.FabricMoOrderRK">
|
|
|
+ select cPlanCode,cCode,MODetailsID,cVCName,cVenName,cVenAbbName,cInvCCode,cInvCode,cInvName,cColor,cBatch,
|
|
|
+ sum(iQuantityIn) as iQuantityIn,sum(iProcessFee) as iProcessFee,sum(iSQuantity) as iSQuantity,
|
|
|
+ sum(iQuantityOut) as iQuantityOut,sum(iSumBillQuantity) as iSumBillQuantity
|
|
|
+ from (
|
|
|
select isnull(a.cCode,'') as cPlanCode,z.cCode,b.MODetailsID,
|
|
|
d.cVCName,c.cVenName,c.cVenAbbName,
|
|
|
x.cInvCode as cInvCode,y.cInvName as cInvName,isnull(x.cFree1,'') as cColor,isnull(x.cBatch,'') as cBatch,
|
|
|
isnull(x.iQuantity,0) as iQuantityIn,
|
|
|
isnull(isnull((select sum(n.iSum) from PurBillVouchs n where n.RdsId =x.autoid),x.iProcessFee),0) as iProcessFee,
|
|
|
isnull(x.iSumBillQuantity,0) as iSumBillQuantity,isnull(x.iSQuantity,0) as iSQuantity,
|
|
|
- (select sum(isnull(iquantity,0)) as iQuantityOut from rdrecords11 d where d.iOMoDID=b.MODetailsID) as iQuantityOut,
|
|
|
+ isnull((select sum(isnull(iquantity,0)) as iQuantityOut from rdrecords11 d where d.iOMoDID=b.MODetailsID),0) as iQuantityOut,
|
|
|
y.cInvCCode
|
|
|
FROM
|
|
|
om_momain a
|
|
@@ -665,46 +261,10 @@
|
|
|
inner join VendorClass d on d.cVCCode =c.cVCCode
|
|
|
WHERE
|
|
|
y.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
|
|
|
+ ) as t1 group by cPlanCode,cCode,MODetailsID,cVCName,cVenName,cVenAbbName,cInvCCode,cInvCode,cInvName,cColor,cBatch
|
|
|
|
|
|
</select>
|
|
|
- <!-- 获取委外出库的纱数量 -->
|
|
|
- <!--
|
|
|
- <select id="getOmOutList01" resultType="org.jeecg.modules.report.entity.FabricInventoryOut">
|
|
|
- SELECT
|
|
|
- b.cInvName,
|
|
|
- isnull( a.cFree1, '' ) AS cColor,
|
|
|
- b.cInvCode,
|
|
|
- sum(isnull( a.iSQuantity, a.iQuantity )) AS iQuantity,
|
|
|
- a.cBatch
|
|
|
- FROM
|
|
|
- rdrecords11 a
|
|
|
- INNER JOIN Inventory b ON a.cInvCode = b.cInvCode
|
|
|
- INNER JOIN OM_MODetails d ON d.MODetailsID = a.iOMoDID
|
|
|
- INNER JOIN om_momain e ON e.moid = d.moid
|
|
|
- WHERE
|
|
|
- b.cInvCCode NOT LIKE '19%'
|
|
|
- AND e.cCode LIKE CONCAT(#{code},'%')
|
|
|
- and b.cInvCCode like '01%'
|
|
|
- group by b.cinvname,a.cFree1,b.cinvcode,a.cbatch
|
|
|
-
|
|
|
- </select>-->
|
|
|
- <!-- 获取委外订单行id,入库物料编号+颜色,处理费用,入库数量 -->
|
|
|
- <!--
|
|
|
- <select id="getOmRowInfoList" resultType="map">
|
|
|
- select b.MODetailsID,
|
|
|
- b.cinvcode+isnull(b.cfree1,'') as cInvCodeColorIn,
|
|
|
- isnull((select isnull(sum(y.iSum),sum(x.iProcessFee)) from rdrecords01 x inner join PurBillVouchs y on y.RdsId =x.autoid where x.iOMoDID=b.MODetailsID),0) as iProcessFee,
|
|
|
- isnull((select sum(x.iQuantity) from rdrecords01 x where x.iOMoDID=b.MODetailsID),0) as iQuantityIn
|
|
|
-
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- WHERE
|
|
|
- c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
- </select>-->
|
|
|
<!-- 获取委外订单行id,出库物料信息,出库数量 -->
|
|
|
<select id="getOmRowOutList" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
|
|
|
select MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName,sum(iQuantityOut) as iQuantityOut from
|
|
@@ -723,7 +283,7 @@
|
|
|
inner join Vendor x on x.cVenCode=a.cVenCode
|
|
|
WHERE
|
|
|
c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
|
|
|
) union all (
|
|
|
select b.MODetailsID,
|
|
|
g.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(g.cColor,'') as cColorOut,
|
|
@@ -740,182 +300,13 @@
|
|
|
inner join Vendor x on x.cVenCode=a.cVenCode
|
|
|
WHERE
|
|
|
c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
+ AND a.cCode LIKE CONCAT(#{code},'%') and a.cCode not like '%样%'
|
|
|
)) as t1
|
|
|
group by MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut,cOmCode,cOmVenAbbName
|
|
|
-<!--
|
|
|
- select b.MODetailsID,
|
|
|
- d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(d.cFree1,'') as cColorOut,
|
|
|
- isnull(d.cBatch,'') as cBatchOut,
|
|
|
- isnull(sum(d.iQuantity-d.iSQuantity+isnull(y.iQuantity,0)),0) as iQuantityOut,
|
|
|
- z.cInvCCode as cInvCCodeOut,a.cCode as cOmCode,x.cVenAbbName as cOmVenAbbName
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
|
|
|
- inner join Vendor x on x.cVenCode=a.cVenCode
|
|
|
- left outer join VIEW_OM_OUT_SETTLEVOUCE y on d.autoid=y.iRdsID
|
|
|
- WHERE
|
|
|
- c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode LIKE CONCAT(#{code},'%')
|
|
|
- AND (y.cmocode is null or y.cmocode LIKE CONCAT(#{code},'%'))
|
|
|
- group by b.MODetailsID,
|
|
|
- d.cInvCode,z.cInvName,d.cFree1,d.cBatch,z.cInvCCode,a.cCode,x.cVenAbbName-->
|
|
|
</select>
|
|
|
- <!-- 获取委外订单出库物料的入库物料信息:包含采购入库、委外入库 -->
|
|
|
- <!--
|
|
|
- <select id="getOmRowInList" resultType="map">
|
|
|
-
|
|
|
- select f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
|
|
|
- e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
|
|
|
- e.iQuantity,
|
|
|
- case when f.cbustype='委外加工' then 0 else
|
|
|
- isnull(isnull((select sum(iSum) from PurBillVouchs x where x.RdsId =e.autoid),iSum ),0)
|
|
|
- end as iPurchuseMoney,
|
|
|
- e.iOMoDID as MODetailsID,
|
|
|
- (select top 1 x.cCode from om_momain x inner join OM_MODetails y on x.moid = y.moid where e.iOMoDID =y.MODetailsID) as moCode,
|
|
|
- (select top 1 x.cPOID from PO_Pomain x inner join PO_Podetails y on x.POID = y.POID where e.iPOsID =y.id) as poCode
|
|
|
- from rdrecords01 e
|
|
|
- inner join rdrecord01 f on e.id=f.id
|
|
|
- inner join Vendor g on g.cVenCode=f.cVenCode
|
|
|
- where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
-
|
|
|
- select
|
|
|
- d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- WHERE
|
|
|
- c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode like CONCAT(#{code},'%')
|
|
|
-
|
|
|
- ) and e.iQuantity>0
|
|
|
- </select>-->
|
|
|
- <!-- 获取委外订单出库物料的入库物料信息:包含其他入库 -->
|
|
|
- <!--
|
|
|
- <select id="getOmRowInList2" resultType="map">
|
|
|
- select f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
|
|
|
- e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
|
|
|
- e.iQuantity,
|
|
|
- isnull(case when f.cMaker='王行乔' then e.iPrice else e.iPrice*1.13 end,0) as iPurchuseMoney,
|
|
|
- null as MODetailsID,'其他入库' as moCode,'其他入库' as poCode
|
|
|
- from rdrecords08 e
|
|
|
- inner join rdrecord08 f on e.id=f.id
|
|
|
- where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
-
|
|
|
- select
|
|
|
- d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- WHERE
|
|
|
- f.cbustype='其他入库'
|
|
|
- and c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode like CONCAT(#{code},'%')
|
|
|
-
|
|
|
-
|
|
|
- ) and e.iQuantity>0 order by e.autoid desc
|
|
|
- </select>-->
|
|
|
- <!-- 根据形态转换物料获取采购入库 -->
|
|
|
- <!--
|
|
|
- <select id="getOmRowInListWithAV" resultType="map">
|
|
|
-
|
|
|
- select e.autoid,f.cBusType,f.cCode,g.cVenName,g.cVenAbbName,
|
|
|
- e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
|
|
|
- e.iQuantity,
|
|
|
- case when f.cbustype='委外加工' then 0 else
|
|
|
- isnull(isnull((select sum(iSum) from PurBillVouchs x where x.RdsId =e.autoid),iSum ),0)
|
|
|
- end as iPurchuseMoney,
|
|
|
- e.iOMoDID as MODetailsID,
|
|
|
- (select top 1 x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') from
|
|
|
- VIEW_FabricLoss_AssemVouchs x where
|
|
|
- x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'')=e.cInvCode+isnull(e.cfree1,'')+isnull(e.cBatch,'')) as cInvIdOut,
|
|
|
- (select top 1 x.cCode from om_momain x inner join OM_MODetails y on x.moid = y.moid where e.iOMoDID =y.MODetailsID) as moCode,
|
|
|
- (select top 1 x.cPOID from PO_Pomain x inner join PO_Podetails y on x.POID = y.POID where e.iPOsID =y.id) as poCode
|
|
|
- from rdrecords01 e
|
|
|
- inner join rdrecord01 f on e.id=f.id
|
|
|
- inner join Vendor g on g.cVenCode=f.cVenCode
|
|
|
- where
|
|
|
- e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
- select x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'') from
|
|
|
- VIEW_FabricLoss_AssemVouchs x
|
|
|
- where x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') in (
|
|
|
- select
|
|
|
- e.cInvCode+isnull(e.cFree1,'')+isnull(e.cBatch,'')
|
|
|
- from rdrecords08 e
|
|
|
- inner join rdrecord08 f on e.id=f.id
|
|
|
- where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
-
|
|
|
- select
|
|
|
- d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- WHERE
|
|
|
- f.cbustype='转换入库'
|
|
|
- and c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode like CONCAT(#{code},'%')
|
|
|
-
|
|
|
-
|
|
|
- ) and e.iQuantity>0
|
|
|
- )
|
|
|
-
|
|
|
- )
|
|
|
- and e.iQuantity>0
|
|
|
- </select>-->
|
|
|
- <!-- 根据形态转换物料获取其他入库信息 -->
|
|
|
- <!--
|
|
|
- <select id="getOmRowInListWithAV2" resultType="map">
|
|
|
- select e.autoid,f.cBusType,f.cCode,'' as cVenName,'' as cVenAbbName,
|
|
|
- e.cInvCode,isnull(e.cFree1,'') as cColor,isnull(e.cBatch,'') as cBatch,
|
|
|
- e.iQuantity,
|
|
|
- isnull(case when f.cMaker='王行乔' then e.iPrice else e.iPrice*1.13 end,0) as iPurchuseMoney,
|
|
|
- null as MODetailsID,
|
|
|
- (select top 1 x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') from
|
|
|
- VIEW_FabricLoss_AssemVouchs x where
|
|
|
- x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'')=e.cInvCode+isnull(e.cfree1,'')+isnull(e.cBatch,'')) as cInvIdOut,
|
|
|
- '其他入库' as moCode,'其他入库' as poCode
|
|
|
- from rdrecords08 e
|
|
|
- inner join rdrecord08 f on e.id=f.id
|
|
|
- where
|
|
|
- e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
- select x.cInvCode+isnull(x.cColor,'')+isnull(x.cAVBatch,'') from
|
|
|
- VIEW_FabricLoss_AssemVouchs x
|
|
|
- where x.cInvCode2+isnull(x.cColor2,'')+isnull(x.cAVBatch2,'') in (
|
|
|
- select
|
|
|
- e.cInvCode+isnull(e.cFree1,'')+isnull(e.cBatch,'')
|
|
|
- from rdrecords08 e
|
|
|
- inner join rdrecord08 f on e.id=f.id
|
|
|
- where e.cinvcode+isnull(e.cfree1,'')+isnull(cbatch,'') in (
|
|
|
-
|
|
|
- select
|
|
|
- d.cInvCode+isnull(d.cFree1,'')+isnull(d.cBatch,'')
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- INNER JOIN OM_MODetails b ON a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- WHERE
|
|
|
- f.cbustype='转换入库'
|
|
|
- and c.cInvCCode NOT LIKE '19%'
|
|
|
- AND a.cCode like CONCAT(#{code},'%')
|
|
|
- ) and e.iQuantity>0
|
|
|
- )
|
|
|
-
|
|
|
- )
|
|
|
- and e.iQuantity>0 and f.cbustype in ('其他入库','转换入库') order by e.autoid desc
|
|
|
- </select>-->
|
|
|
<!-- 获取销售订单附件 -->
|
|
|
<select id="getSoAccList" resultType="org.jeecg.modules.report.entity.AccessorItem">
|
|
|
- select distinct cFileId,Filename from VIEW_ACC_LIST_SO where cSoCode=#{cSoCode}
|
|
|
+ select distinct cFileId,Filename from VIEW_ACC_LIST_SO where cSoCode=#{cSoCode} and cSoCode not like '%样%'
|
|
|
</select>
|
|
|
<!-- 获取附件详情 -->
|
|
|
<select id="getAccDetail" resultType="map">
|
|
@@ -928,7 +319,7 @@
|
|
|
from OM_MOMain a inner join om_modetails b on a.moid=b.moid
|
|
|
inner join VoucherAccessories f on f.voucherid=a.moid
|
|
|
where f.vouchertypeid='OM01'
|
|
|
- and a.cCode like CONCAT(#{code},'%')
|
|
|
+ and a.cCode like CONCAT(#{code},'%') and a.cCode not like '%样%'
|
|
|
</select>
|
|
|
<!-- 获取采购入库仓库库存 -->
|
|
|
<select id="getPurchaseStockList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
|
|
@@ -942,7 +333,7 @@
|
|
|
inner join PO_Podetails p on o.POID =p.POID
|
|
|
inner join Inventory q on p.cInvCode=q.cInvCode
|
|
|
inner join RdRecords01 r on r.iposid=p.id
|
|
|
- where o.cPOID like CONCAT(#{code},'%')
|
|
|
+ where o.cPOID like CONCAT(#{code},'%') and o.cPOID not like '%样%'
|
|
|
and (q.cInvCCode LIKE '01%'
|
|
|
or q.cInvCCode LIKE '02%'
|
|
|
or q.cInvCCode LIKE '03%'
|
|
@@ -959,17 +350,6 @@
|
|
|
</foreach>
|
|
|
|
|
|
</select>
|
|
|
- <!-- 获取委外订单国外出库数量 -->
|
|
|
- <!--
|
|
|
- <select id="getOmInGwOutList" resultType="org.jeecg.modules.report.entity.FabricPoOrderOut">
|
|
|
- select b.cInvCode,isnull(b.cFree1,'') as cColor,isnull(b.cBatch,'') as cBatch,b.iQuantity from rdrecord32 a inner join rdrecords32 b
|
|
|
- on a.id=b.id
|
|
|
- where b.cinvCode+isnull(cfree1,'')+isnull(cbatch,'') in
|
|
|
- <foreach item="item" collection="invIdList" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
-
|
|
|
- </select>-->
|
|
|
<!-- 获取事故单 -->
|
|
|
<select id="getAccidentList" resultType="org.jeecg.modules.report.entity.FabricAccident">
|
|
|
SELECT ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName,sum(A.iOriSum) as iOriSum
|
|
@@ -978,7 +358,7 @@
|
|
|
left join Inventory inv on inv.cInvCode=a.cInvCode
|
|
|
left join Vendor ven on ven.cVenCode=ah.cvencode
|
|
|
where cPBVBillType='03'
|
|
|
- and inv.cInvName='事故单' and ah.cDefine2 like CONCAT(#{code},'%')
|
|
|
+ and inv.cInvName='事故单' and ah.cDefine2 like CONCAT(#{code},'%') and ah.cDefine2 not like '%样%'
|
|
|
group by ah.cPBVMemo,ah.cPBVCode,VEN.cVenAbbName
|
|
|
|
|
|
</select>
|
|
@@ -1067,12 +447,12 @@
|
|
|
(
|
|
|
select cInvCode,isnull(cFree1,'') as cColor,isnull(cbatch,'') as cBatch,comcode as cCode,isnull(iSQuantity,iquantity) as iQuantity,0 as iPrice
|
|
|
from rdrecords11 where
|
|
|
- comcode not like CONCAT(#{code},'%')
|
|
|
+ (comcode not like CONCAT(#{code},'%') or comcode like '%样%')
|
|
|
and (cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
|
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
|
|
|
inner join om_momain f on f.moid = e.moid
|
|
|
- where f.cCode like CONCAT(#{code},'%')
|
|
|
+ where f.cCode like CONCAT(#{code},'%') and f.cCode not like '%样%'
|
|
|
)
|
|
|
or cInvCode+isnull(cFree1,'')+isnull(cbatch,'') in (
|
|
|
select cInvCode2+isnull(cColor2,'')+isnull(cAVBatch2,'') from VIEW_FabricLoss_AssemVouchs where
|
|
@@ -1080,7 +460,7 @@
|
|
|
select b.cinvcode+isnull(b.cfree1,'')+isnull(b.cbatch,'') from RdRecords01 b
|
|
|
INNER JOIN OM_MODetails e on b.iOMoDID=e.MODetailsID
|
|
|
inner join om_momain f on f.moid = e.moid
|
|
|
- where f.cCode like CONCAT(#{code},'%')
|
|
|
+ where f.cCode like CONCAT(#{code},'%') and f.cCode not like '%样%'
|
|
|
)
|
|
|
)
|
|
|
)
|
|
@@ -1099,7 +479,7 @@
|
|
|
inner join OM_MODetails p on o.moid =p.moid
|
|
|
inner join Inventory q on p.cInvCode=q.cInvCode
|
|
|
inner join RdRecords01 r on r.iOMoDID=p.MODetailsID
|
|
|
- where o.cCode like CONCAT(#{code},'%')
|
|
|
+ where o.cCode like CONCAT(#{code},'%') and o.cCode not like '%样%'
|
|
|
)
|
|
|
</select>
|
|
|
<!--获取本次委外入库的形态转换-->
|
|
@@ -1110,7 +490,7 @@
|
|
|
select cInvCode+isnull(cBatch,'')+isnull(cFree1,'') from RdRecords01
|
|
|
where iOMoDID in (
|
|
|
select b.MODetailsID from om_momain a inner join OM_MODetails b on a.moid =b.moid
|
|
|
- and a.cCode like CONCAT(#{code},'%')
|
|
|
+ and a.cCode like CONCAT(#{code},'%') and a.cCode not like '%样%'
|
|
|
)
|
|
|
)
|
|
|
</select>
|
|
@@ -1155,26 +535,6 @@
|
|
|
)
|
|
|
) as t1
|
|
|
group by MODetailsID,cInvCodeOut,cInvNameOut,cColorOut,cBatchOut,cInvCCodeOut
|
|
|
-<!--
|
|
|
- select b.MODetailsID,
|
|
|
- d.cInvCode as cInvCodeOut,z.cInvName as cInvNameOut,isnull(d.cFree1,'') as cColorOut,
|
|
|
- isnull(d.cBatch,'') as cBatchOut,
|
|
|
- isnull(sum(d.iQuantity-d.iSQuantity+isnull(y.iQuantity,0)),0) as iQuantityOut,
|
|
|
- z.cInvCCode as cInvCCodeOut
|
|
|
- FROM
|
|
|
- om_momain a
|
|
|
- inner join OM_MODetails b on a.moid = b.moid
|
|
|
- INNER JOIN Inventory c ON b.cinvcode = c.cinvcode
|
|
|
- inner join rdrecords11 d on d.iOMoDID=b.MODetailsID
|
|
|
- INNER JOIN Inventory z ON d.cinvcode = z.cinvcode
|
|
|
- left outer join VIEW_OM_OUT_SETTLEVOUCE y on d.autoid=y.iRdsID
|
|
|
- WHERE
|
|
|
- b.MODetailsID in
|
|
|
- <foreach item="item" collection="detailIdList" index="index" open="(" separator="," close=")">
|
|
|
- #{item}
|
|
|
- </foreach>
|
|
|
- AND (y.cmocode is null or y.cmocode=a.cCode)
|
|
|
- group by b.MODetailsID,d.cInvCode,z.cInvName,d.cFree1,d.cBatch,z.cInvCCode-->
|
|
|
</select>
|
|
|
<!-- 根据物料id获取入库信息:采购入库、委外入库、转换入库、其他入库 -->
|
|
|
<select id="getInListByInvId" resultType="org.jeecg.modules.report.entity.FabricCommonIn">
|
|
@@ -1217,7 +577,7 @@
|
|
|
<!-- 获取成衣委外出库 -->
|
|
|
<select id="getOmOutList19" resultType="org.jeecg.modules.report.entity.FabricMoOrderCK">
|
|
|
|
|
|
- select * from VIEW_OM_OUT_19 where cOmCode like CONCAT(#{code},'%')
|
|
|
+ select * from VIEW_OM_OUT_19 where cOmCode like CONCAT(#{code},'%') and cOmCode not like '%样%'
|
|
|
|
|
|
</select>
|
|
|
<!-- 根据委外订单子表id,获取入库详情-->
|
|
@@ -1254,7 +614,8 @@
|
|
|
inner join OM_MODetails b on a.moid=b.moid
|
|
|
inner join rdrecords32 c on c.iorderdid =b.isosid
|
|
|
INNER JOIN Inventory d ON c.cinvcode = d.cinvcode
|
|
|
- where a.ccode like CONCAT(#{code},'%')
|
|
|
+ where a.ccode like CONCAT(#{code},'%') and a.ccode not like '%样%' and
|
|
|
+ (d.cInvCCode like '01%' or d.cInvCCode like '02%' or d.cInvCCode like '03%' or d.cInvCCode like '04%')
|
|
|
|
|
|
</select>
|
|
|
</mapper>
|