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) {