修订,离职交接配置

This commit is contained in:
杰 朱
2021-06-29 16:12:29 +08:00
parent 79314a384b
commit 5fa6a403f6
3 changed files with 89 additions and 25 deletions

View File

@@ -168,7 +168,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Rem
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
left JOIN
mom_motype motype WITH (NOLOCK) ON motype.MoTypeId = md.MoTypeId
INNER JOIN
left JOIN
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
@@ -199,12 +199,14 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate ,md.Rem
WHERE md.Status = 3
GROUP BY ma.InvCode) shwl ON ma.InvCode = shwl.InvCode LEFT JOIN
(SELECT mom.MoCode, ma.invcode,round(SUM(isnull(ma.qty, 0))/md.Qty,3) dtty
(select a.MoCode ,a.InvCode ,a.MoDId ,(a.dtty/b.Qty) as dtty from (
SELECT mom.MoCode, ma.invcode,round(SUM(isnull(ma.qty, 0)),3) dtty, md.MoDId
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join
mom_order mom WITH (NOLOCK) on md.MoId=mom.MoId
GROUP BY ma.InvCode,mom.MoCode,md.Qty ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode LEFT JOIN
mom_order mom WITH (NOLOCK) on md.MoId=mom.MoId
GROUP BY ma.InvCode,mom.MoCode, md.MoDId ) a left join mom_orderdetail b WITH (NOLOCK) ON a.MoDId = b.MoDId ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode and md.MoDId= dtyl.MoDId
LEFT JOIN
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
@@ -288,7 +290,7 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate,md.Rema
mom_moallocate ma WITH (NOLOCK) ON md.MoDId = ma.MoDId
left JOIN
mom_motype motype WITH (NOLOCK) ON motype.MoTypeId = md.MoTypeId
INNER JOIN
left JOIN
(SELECT ma.invcode, SUM(isnull(ma.qty, 0) - isnull(issqty, 0)) wqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId
@@ -321,11 +323,14 @@ SELECT m..mocode,CONVERT(varchar(100), mor.StartDate, 23) as StartDate,md.Rema
GROUP BY ma.InvCode) shwl ON ma.InvCode = shwl.InvCode LEFT JOIN
(SELECT mom.MoCode, ma.invcode,round(SUM(isnull(ma.qty, 0))/md.Qty,3) dtty
(select a.MoCode ,a.InvCode ,a.MoDId ,(a.dtty/b.Qty) as dtty from (
SELECT mom.MoCode, ma.invcode,round(SUM(isnull(ma.qty, 0)),3) dtty, md.MoDId
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN
mom_orderdetail md WITH (NOLOCK) ON ma.MoDId = md.MoDId left join
mom_order mom WITH (NOLOCK) on md.MoId=mom.MoId
GROUP BY ma.InvCode,mom.MoCode,md.Qty ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode LEFT JOIN
mom_order mom WITH (NOLOCK) on md.MoId=mom.MoId
GROUP BY ma.InvCode,mom.MoCode, md.MoDId ) a left join mom_orderdetail b WITH (NOLOCK) ON a.MoDId = b.MoDId ) dtyl ON ma.InvCode = dtyl.InvCode and dtyl.MoCode=m.MoCode and md.MoDId= dtyl.MoDId
LEFT JOIN
(SELECT ma.invcode, SUM( isnull(issqty, 0)) issqty
FROM mom_moallocate ma WITH (NOLOCK) INNER JOIN