sql 查询优化:COUNT(*)改成COUNT(1)
This commit is contained in:
@@ -38,7 +38,7 @@ namespace FineUIPro.Web.HJGL.LeakVacuum
|
||||
LEFT JOIN dbo.PTP_PipelineList AS IsoList ON IsoList.PipelineId = IsoInfo.PipelineId
|
||||
LEFT JOIN PTP_TestPackage As Test ON Test.PTP_ID =IsoList.PTP_ID
|
||||
WHERE IsoInfo.ProjectId= @ProjectId
|
||||
AND UnitWork.UnitWorkId= @UnitWorkId and (select count(*) from HJGL_LV_Pipeline p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
AND UnitWork.UnitWorkId= @UnitWorkId and (select count(1) from HJGL_LV_Pipeline p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
if (!string.IsNullOrEmpty(PTP_ID))
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace FineUIPro.Web.HJGL.PurgingCleaning
|
||||
LEFT JOIN dbo.PTP_PipelineList AS IsoList ON IsoList.PipelineId = IsoInfo.PipelineId
|
||||
LEFT JOIN PTP_TestPackage As Test ON Test.PTP_ID =IsoList.PTP_ID
|
||||
WHERE IsoInfo.ProjectId= @ProjectId And Test.FinishDef is not null
|
||||
AND UnitWork.UnitWorkId= @UnitWorkId and (select count(*) from HJGL_PC_Pipeline p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
AND UnitWork.UnitWorkId= @UnitWorkId and (select count(1) from HJGL_PC_Pipeline p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", UnitWorkId));
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace FineUIPro.Web.HJGL.TestPackage
|
||||
LEFT JOIN dbo.Base_TestMedium AS testMedium ON testMedium.TestMediumId = IsoInfo.TestMedium
|
||||
LEFT JOIN dbo.Base_PipingClass class ON class.PipingClassId = IsoInfo.PipingClassId
|
||||
WHERE IsoInfo.ProjectId= @ProjectId AND UnitWork.UnitWorkId= @UnitWorkId
|
||||
and (select count(*) from PTP_PipelineList p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
and (select count(1) from PTP_PipelineList p where p.PipelineId=IsoInfo.PipelineId)=0";
|
||||
List<SqlParameter> listStr = new List<SqlParameter>();
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.CurrUser.LoginProjectId));
|
||||
listStr.Add(new SqlParameter("@UnitWorkId", UnitWorkId));
|
||||
|
||||
Reference in New Issue
Block a user