各小需求,修订
This commit is contained in:
@@ -165,6 +165,14 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
|
||||
List<string> where = new List<string>();
|
||||
if (!string.IsNullOrEmpty(info1.cMaker))
|
||||
{
|
||||
where.Add(" mmm.cpersonname like @cMaker");
|
||||
}
|
||||
if (!string.IsNullOrEmpty(info1.vendor))
|
||||
{
|
||||
where.Add(" mmm.cvenabbname like @vendor ");
|
||||
}
|
||||
|
||||
if (info1.InvCodes != null)
|
||||
{
|
||||
@@ -196,7 +204,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
using (var conn = NX.ERP.U8.U8LoginContext.Instance.Connection)
|
||||
{
|
||||
return conn.Query<object>(sql, new { cinvcode = info1.InvCodes, cInvStd = $"%{info1.InvStd}%", info1.PoCodes, info1.AppCodes, info1.BeginDate, info1.EndDate, info1.BeginDate2, info1.EndDate2 });
|
||||
return conn.Query<object>(sql, new { cinvcode = info1.InvCodes, info1.cMaker, info1.vendor, cInvStd = $"%{info1.InvStd}%", info1.PoCodes, info1.AppCodes, info1.BeginDate, info1.EndDate, info1.BeginDate2, info1.EndDate2 });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -232,7 +240,7 @@ namespace NX.ERP.U8.Purchase
|
||||
)
|
||||
|
||||
insert into @RdRecord
|
||||
select cPsn_Num, cPsn_Name,0,0,0,0 from hr_v_HR31_show where cDepCode ='52' and rEmployState ='在职'
|
||||
select cPsn_Num, cPsn_Name,0,0,0,0 from hr_v_HR31_show WITH (nolock) where cDepCode ='52' and rEmployState ='在职' and cPsn_Name <>'朱华英'
|
||||
|
||||
insert into @RdRecord
|
||||
select 'qt999','其他',0,0,0,0
|
||||
@@ -259,7 +267,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
(
|
||||
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a, PO_Podetails b where a.poid=b.poid)
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1
|
||||
)
|
||||
as tbl on tbl1.cinvcode=tbl.cInvCode
|
||||
@@ -291,7 +299,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
(
|
||||
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a, PO_Podetails b where a.poid=b.poid)
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1
|
||||
)
|
||||
as tbl on tbl1.cinvcode=tbl.cInvCode
|
||||
@@ -299,7 +307,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
update a set a.puappnum03=b.puappnumall From @RdRecord a left join @RdRecord3 b on a.cpersonname =b.cpersonname
|
||||
|
||||
update a set a.puappnum03= a.puappnumall +b.puappnumall From @RdRecord a left join (
|
||||
update a set a.puappnum03= a.puappnum03 +b.puappnumall From @RdRecord a left join (
|
||||
select '其他' as cpersonname ,sum(puappnumall) as puappnumall from @RdRecord3 where cpersonname not in (select cpersonname From @RdRecord) )b on a.cpersonname =b.cpersonname
|
||||
where a.cpersonname='其他'
|
||||
|
||||
@@ -328,7 +336,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
(
|
||||
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a, PO_Podetails b where a.poid=b.poid)
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1
|
||||
)
|
||||
as tbl on tbl1.cinvcode=tbl.cInvCode )
|
||||
@@ -365,7 +373,7 @@ namespace NX.ERP.U8.Purchase
|
||||
|
||||
(
|
||||
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a, PO_Podetails b where a.poid=b.poid)
|
||||
select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (NOLOCK), PO_Podetails b WITH (NOLOCK) where a.poid=b.poid)
|
||||
as c where c.rownumber=1
|
||||
)
|
||||
as tbl on tbl1.cinvcode=tbl.cInvCode )
|
||||
@@ -407,7 +415,7 @@ namespace NX.ERP.U8.Purchase
|
||||
FROM PO_Podetails WITH (nolock)
|
||||
GROUP BY iAppIds) rds ON isnull(ommds.autoid,'') = isnull(rds.iAppIds,'')
|
||||
left join
|
||||
(select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a, PO_Podetails b where a.poid=b.poid)
|
||||
(select cInvCode,cMaker from ( select cInvCode,ROW_NUMBER() over( partition by b.cInvCode order by a.poid desc) as rownumber ,a.cMaker from PO_Pomain a WITH (nolock), PO_Podetails b WITH (nolock) where a.poid=b.poid)
|
||||
as c where c.rownumber=1) f on ommds.cInvCode =f.cInvCode
|
||||
WHERE ISNULL(OMM.cCloser, N'') = N'' AND ISNULL(ommds.cbCloser, N'') = N'' AND ISNULL(rds.qty, 0)=0 and ommds.iReceivedQTY=0 AND
|
||||
ommds.fquantity - ISNULL(rds.qty, 0) > 0 ) puu
|
||||
|
||||
Reference in New Issue
Block a user