From ae228f26afcc76b3c9478b19b36ceae6e4adc226 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=A6=20=E8=B5=B5?= <89237069@qq.com> Date: Mon, 2 Nov 2020 16:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs b/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs index 4d438c7..7ea45af 100644 --- a/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs +++ b/SCP/Views/PlanData/SCP_PO_PLAN_EXTEND.aspx.cs @@ -49,7 +49,11 @@ namespace SCP.PlanData SearchV_TB_PO((result)=> { Grid_V_TB_PO.RecordCount = result.Count(); var list = SortAndPage(result, Grid_V_TB_PO); - string str = "SELECT MAX(B.EndTime) EndTime ,a.PoBillNum ,a.site,max(B.Version) AS Version FROM V_TB_PO A INNER JOIN V_TB_PO_PLAN_EXTEND B ON A.PoBillNum = B.PoBillNum AND B.AskBillNum <> '' and a.Site = b.Domain GROUP BY A.PoBillNum,a.Site"; + +string str = "SELECT MAX(A.EndTime) EndTime ,A.PoBillNum ,Domain AS SITE,max(Version) AS Version\n" + +" FROM [TB_PO_PLAN_EXTEND] A left join TB_ASK B ON A.PoBillNum=B.PoBillNum AND A.Domain=B.Site and A.EndTime=B.EndTime\n" + +" where A.IsDeleted=0 AND B.IsDeleted=0 AND B.AskBillNum<>'' group by A.PoBillNum, a.Domain"; + var _tempList= SCPDB.Database.SqlQuery(str).ToList(); foreach (var itm in list) {