@@ -124,7 +124,7 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
...
@@ -124,7 +124,7 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
{
{
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)dmodel.BuyStatus;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)dmodel.BuyStatus;
}
}
if(dmodel.SchoolId>0)
if(dmodel.SchoolId>=0)
{
{
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.SchoolId)+"="+dmodel.SchoolId;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.SchoolId)+"="+dmodel.SchoolId;
}
}
...
@@ -147,6 +147,7 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
...
@@ -147,6 +147,7 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
if(dmodel.IsWaitDeal==1)
if(dmodel.IsWaitDeal==1)
{
{
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ManagersId)+"="+dmodel.ManagersId;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ManagersId)+"="+dmodel.ManagersId;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Purchased;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ProcurementId)+"=0";
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ProcurementId)+"=0";
}
}
if(dmodel.AuditEmId>0)
if(dmodel.AuditEmId>0)
...
@@ -155,14 +156,14 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
...
@@ -155,14 +156,14 @@ left join rb_property_category pc on pb.CategoryId = pc.Id
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+"="+(int)WFRrocessStatus.NotAudit;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+"="+(int)WFRrocessStatus.NotAudit;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Pending;//需要申请单在审核中
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Pending;//需要申请单在审核中
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =0";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =2";
}
}
if(dmodel.AuditedEmId>0)
if(dmodel.AuditedEmId>0)
{
{
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditEmId)+"="+dmodel.AuditedEmId;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditEmId)+"="+dmodel.AuditedEmId;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+" in("+(int)WFRrocessStatus.AuditThrough+","+(int)WFRrocessStatus.AuditNotThrough+","+(int)WFRrocessStatus.Rejected+")";
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+" in("+(int)WFRrocessStatus.AuditThrough+","+(int)WFRrocessStatus.AuditNotThrough+","+(int)WFRrocessStatus.Rejected+")";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =0";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =2";
}
}
stringsql=$@" select pu.*,pc.Name as CategoryName from
stringsql=$@" select pu.*,pc.Name as CategoryName from
RB_Property_BuyingRequisition pu
RB_Property_BuyingRequisition pu
...
@@ -225,6 +226,7 @@ LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id
...
@@ -225,6 +226,7 @@ LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id
if(dmodel.IsWaitDeal==1)
if(dmodel.IsWaitDeal==1)
{
{
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ManagersId)+"="+dmodel.ManagersId;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ManagersId)+"="+dmodel.ManagersId;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Purchased;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ProcurementId)+"=0";
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.ProcurementId)+"=0";
}
}
if(dmodel.AuditEmId>0)
if(dmodel.AuditEmId>0)
...
@@ -233,22 +235,23 @@ LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id
...
@@ -233,22 +235,23 @@ LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+"="+(int)WFRrocessStatus.NotAudit;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+"="+(int)WFRrocessStatus.NotAudit;
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Pending;//需要申请单在审核中
where+=" and pu."+nameof(RB_Property_BuyingRequisition_Extend.BuyStatus)+"="+(int)BuyingRequisitionStatusEnum.Pending;//需要申请单在审核中
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =0";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =2";
}
}
if(dmodel.AuditedEmId>0)
if(dmodel.AuditedEmId>0)
{
{
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditEmId)+"="+dmodel.AuditedEmId;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditEmId)+"="+dmodel.AuditedEmId;
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+" in("+(int)WFRrocessStatus.AuditThrough+","+(int)WFRrocessStatus.AuditNotThrough+","+(int)WFRrocessStatus.Rejected+")";
where+=" and wa."+nameof(Rb_Workflow_Auditrecord.AuditStatus)+" in("+(int)WFRrocessStatus.AuditThrough+","+(int)WFRrocessStatus.AuditNotThrough+","+(int)WFRrocessStatus.Rejected+")";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.SpecialNode)+" !="+(int)WFSpecialNodeEnum.Pay;//排除签名的
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =0";
where+=" and war."+nameof(Rb_Workflow_AuditRelevance_Extend.TemplateType)+" =2";
}
}
stringsql=$@"
stringsql=$@"
select count(pu.Id) as Number from
SELECT COUNT(0) as Number FROM(
select pu.Id from
RB_Property_BuyingRequisition pu
RB_Property_BuyingRequisition pu
left join rb_workflow_auditrecord wa on pu.Id=wa.WorkFlowId
left join rb_workflow_auditrecord wa on pu.Id=wa.WorkFlowId
LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id
LEFT JOIN rb_workflow_auditrelevance war on wa.AuditId=war.Id