From ab369ff5b0d64847f81b0a3da0cdb1481f71e19b Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 23 十一月 2022 08:45:47 +0800 Subject: [PATCH] 提交 --- zhengcaioa/Services/ProjectService.cs | 16 +++++++--------- 1 files changed, 7 insertions(+), 9 deletions(-) diff --git a/zhengcaioa/Services/ProjectService.cs b/zhengcaioa/Services/ProjectService.cs index 6b8ba4d..03221d8 100644 --- a/zhengcaioa/Services/ProjectService.cs +++ b/zhengcaioa/Services/ProjectService.cs @@ -618,13 +618,12 @@ { sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[drhx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[drhx] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dshx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dshx] = c.[name] ) ) "); + sql.Append(" and ( a.[dshx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dshx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dshx] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[caigourenname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[caigourenname] = c.[name] ) ) "); + sql.Append(" and ( a.[caigourenname] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[caigourenname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[caigourenname] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dailiname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dailiname] = c.[name] ) ) "); + sql.Append(" and ( a.[dailiname] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dailiname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dailiname] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[drhx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[drhx] = c.[name] ) ) "); sql.Append(" and ( (select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] ) = 0 or ( (select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] ) = ( select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and exists ( select d.[Id] from [CooperatecustomCustomer] d where d.rec_status='A' and b.[names] = d.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and b.[names] = c.[name] ) ))) "); sql.Append(" and ( (select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] ) = 0 or ( (select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] ) = ( select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] and exists ( select d.[Id] from [CooperatecustomCustomer] d where d.rec_status='A' and b.[namesyouxiao] = d.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and b.[namesyouxiao] = c.[name] ) ))) "); @@ -634,14 +633,13 @@ { sql.Append(" and not ( ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[drhx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[drhx] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dshx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dshx] = c.[name] ) ) "); + sql.Append(" and ( a.[dshx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dshx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dshx] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[caigourenname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[caigourenname] = c.[name] ) ) "); + sql.Append(" and ( a.[caigourenname] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[caigourenname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[caigourenname] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dailiname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dailiname] = c.[name] ) ) "); + sql.Append(" and ( a.[dailiname] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[dailiname] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[dailiname] = c.[name] ) ) "); - sql.Append(" and ( a.[drhx] is null or exists ( select b.[Id] from [CooperatecustomCustomer] b where b.rec_status='A' and a.[drhx] = b.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and a.[drhx] = c.[name] ) ) "); - + sql.Append(" and ( (select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] ) = 0 or ( (select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] ) = ( select count(b.zhongbiaoId) from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and exists ( select d.[Id] from [CooperatecustomCustomer] d where d.rec_status='A' and b.[names] = d.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and b.[names] = c.[name] ) ))) "); sql.Append(" and ( (select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] ) = 0 or ( (select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] ) = ( select count(b.youxiaoId) from [Projectyouxiao] b where a.[Id]=b.[ProjectId] and exists ( select d.[Id] from [CooperatecustomCustomer] d where d.rec_status='A' and b.[namesyouxiao] = d.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and b.[namesyouxiao] = c.[name] ) ))) "); sql.Append(" and ( (select count(b.reasonId) from [Projectreason] b where a.[Id]=b.[ProjectId] ) = 0 or ( (select count(b.reasonId) from [Projectreason] b where a.[Id]=b.[ProjectId] ) = ( select count(b.reasonId) from [Projectreason] b where a.[Id]=b.[ProjectId] and exists ( select d.[Id] from [CooperatecustomCustomer] d where d.rec_status='A' and b.[reasonname] = d.[name] union select c.[Id] from [IntentionCustomer] c where c.rec_status='A' and b.[reasonname] = c.[name] ) ))) ) "); -- Gitblit v1.9.1