|
@@ -27,7 +27,7 @@
|
|
|
left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
|
|
|
left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
- union
|
|
|
+ union all
|
|
|
select --ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
|
|
|
OM_MOMain.cCode csrccode,
|
|
|
cPlanLotNumber,
|
|
@@ -78,76 +78,55 @@
|
|
|
|
|
|
|
|
|
<select id="selectPage" resultType="org.jeecg.modules.scas.entity.SupplierCapacity">
|
|
|
- /*select * from
|
|
|
- (select ROW_NUMBER() OVER(ORDER BY cVenCode) index1,* from
|
|
|
- (*/select --ROW_NUMBER() OVER(ORDER BY PO_Pomain.poid) index1,
|
|
|
- PO_Pomain.cPOID csrccode,
|
|
|
- PlanLotNumber cPlanLotNumber,
|
|
|
- cDepname cDepCode,
|
|
|
- cPersonName cPersonCode,
|
|
|
- cVenName cVenCode,
|
|
|
- cVCName cVenCodeType,
|
|
|
- '采购订单' iOrderType,
|
|
|
- iQuantity,
|
|
|
- iReceivedQTY,
|
|
|
- cComUnitName unit,
|
|
|
- month(dArriveDate) arriveMonth,
|
|
|
- dArriveDate,
|
|
|
- isnull(Inventory.cInvDefine1,0) coefficient
|
|
|
- from PO_Pomain
|
|
|
- left join PO_Podetails on PO_Podetails.POID=PO_Pomain.POID
|
|
|
- left join Department on Department.cdepcode=PO_Pomain.cDepCode
|
|
|
- left join Person on Person.cPersonCode=PO_Pomain.cPersonCode
|
|
|
- left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
|
|
|
- left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
- left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
|
|
|
- left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
- ${ew.customSqlSegment}
|
|
|
- <!--union
|
|
|
- select --ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
|
|
|
- OM_MOMain.cCode csrccode,
|
|
|
- cPlanLotNumber,
|
|
|
- cDepname cDepCode,
|
|
|
- cPersonName cPersonCode,
|
|
|
- cVenName cVenCode,
|
|
|
- cVCName cVenCodeType,
|
|
|
- '委外订单' iOrderType,
|
|
|
- iQuantity,
|
|
|
- iReceivedQTY,
|
|
|
- cComUnitName unit,
|
|
|
- month(dArriveDate) arriveMonth,
|
|
|
- dArriveDate,
|
|
|
- isnull(Inventory.cInvDefine1,0) coefficient
|
|
|
- from OM_MOMain
|
|
|
- left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
|
|
|
- left join Department on Department.cdepcode=OM_MOMain.cDepCode
|
|
|
- left join Person on Person.cPersonCode=OM_MOMain.cPersonCode
|
|
|
- left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
|
|
|
- left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
- left join ComputationUnit on OM_MODetails.cUnitID=ComputationUnit.cComunitCode
|
|
|
- left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
|
|
|
- ) p
|
|
|
- <where>
|
|
|
- <if test="qw.csrccode!=null">
|
|
|
- and csrccode=#{qw.csrccode}----订单号
|
|
|
- </if>
|
|
|
- <if test="qw.orderType!=null">
|
|
|
- AND iOrderType=#{qw.orderType}--订单类型
|
|
|
- </if>
|
|
|
- <if test="qw.venCode!=null">
|
|
|
- and cVenCode=#{qw.venCode}--供应商
|
|
|
- </if>
|
|
|
- <if test="qw.planLotNumber!=null">
|
|
|
- and cPlanLotNumber=#{qw.planLotNumber}--计划单号
|
|
|
- </if>
|
|
|
- <if test="qw.startDate!=null">
|
|
|
- and arriveMonth>=$#{qw.startDate} --起始日期
|
|
|
- </if>
|
|
|
- <if test="qw.endDate!=null">
|
|
|
- and arriveMonth<=$#{qw.endDate} --结束日期
|
|
|
- </if>
|
|
|
- </where>
|
|
|
- )-->
|
|
|
+ --测试
|
|
|
+ select * from(
|
|
|
+ select
|
|
|
+ PO_Pomain.cPOID csrccode,
|
|
|
+ PlanLotNumber cPlanLotNumber,
|
|
|
+ cDepname cDepCode,
|
|
|
+ cPersonName cPersonCode,
|
|
|
+ cVenName cVenCode,
|
|
|
+ cVCName cVenCodeType,
|
|
|
+ '采购订单' iOrderType,
|
|
|
+ iQuantity,
|
|
|
+ iReceivedQTY,
|
|
|
+ cComUnitName unit,
|
|
|
+ month(dArriveDate) arriveMonth,
|
|
|
+ dArriveDate,
|
|
|
+ isnull(Inventory.cInvDefine1,0) coefficient
|
|
|
+ from PO_Pomain
|
|
|
+ left join PO_Podetails on PO_Podetails.POID=PO_Pomain.POID
|
|
|
+ left join Department on Department.cdepcode=PO_Pomain.cDepCode
|
|
|
+ left join Person on Person.cPersonCode=PO_Pomain.cPersonCode
|
|
|
+ left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
|
|
|
+ left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
+ left join ComputationUnit on PO_Podetails.cUnitID=ComputationUnit.cComunitCode
|
|
|
+ left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
+ union ALL
|
|
|
+ select --ROW_NUMBER() OVER(ORDER BY OM_MOMain.moid) index1,
|
|
|
+ OM_MOMain.cCode csrccode,
|
|
|
+ cPlanLotNumber,
|
|
|
+ cDepname cDepCode,
|
|
|
+ cPersonName cPersonCode,
|
|
|
+ cVenName cVenCode,
|
|
|
+ cVCName cVenCodeType,
|
|
|
+ '委外订单' iOrderType,
|
|
|
+ iQuantity,
|
|
|
+ iReceivedQTY,
|
|
|
+ cComUnitName unit,
|
|
|
+ month(dArriveDate) arriveMonth,
|
|
|
+ dArriveDate,
|
|
|
+ isnull(Inventory.cInvDefine1,0) coefficient
|
|
|
+ from OM_MOMain
|
|
|
+ left join OM_MODetails on OM_MODetails.moid=OM_MOMain.moid
|
|
|
+ left join Department on Department.cdepcode=OM_MOMain.cDepCode
|
|
|
+ left join Person on Person.cPersonCode=OM_MOMain.cPersonCode
|
|
|
+ left join Vendor on Vendor.cVenCode=OM_MOMain.cVenCode
|
|
|
+ left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
+ left join ComputationUnit on OM_MODetails.cUnitID=ComputationUnit.cComunitCode
|
|
|
+ left join Inventory on OM_MODetails.cInvCode=Inventory.cInvCode
|
|
|
+ )p
|
|
|
+ ${ew.customSqlSegment}
|
|
|
</select>
|
|
|
|
|
|
<select id="excel001" resultType="org.jeecg.modules.scas.entity.vo.SupplierCapacityVo1">
|
|
@@ -174,7 +153,7 @@
|
|
|
left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
--order by cDepCode,cVenCode,arriveMonth
|
|
|
- UNION
|
|
|
+ union all
|
|
|
select cDepname cDepCode,
|
|
|
cVenName cVenCode,
|
|
|
month(dArriveDate) arriveMonth,
|
|
@@ -216,7 +195,7 @@
|
|
|
left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
|
|
|
left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
- UNION
|
|
|
+ union all
|
|
|
select
|
|
|
cDepname cDepCode,
|
|
|
month(dArriveDate) arriveMonth,
|
|
@@ -258,7 +237,7 @@
|
|
|
left join Vendor on Vendor.cVenCode=PO_Pomain.cVenCode
|
|
|
left join VendorClass on VendorClass.cVCCode=Vendor.cVCCode
|
|
|
left join Inventory on PO_Podetails.cInvCode=Inventory.cInvCode
|
|
|
- union
|
|
|
+ union all
|
|
|
select ROW_NUMBER() OVER(ORDER BY cVenName) index1,
|
|
|
cVenName cVenCode,
|
|
|
month(dArriveDate) arriveMonth,
|