From 82645238a5855f6f7b8c397d1f8fa8b4a3155b94 Mon Sep 17 00:00:00 2001 From: username@email.com <yzy2002yzy@163.com> Date: 星期三, 14 七月 2021 16:00:18 +0800 Subject: [PATCH] 提交 --- zhengcaioa/Services/ProjectService.cs | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 files changed, 54 insertions(+), 3 deletions(-) diff --git a/zhengcaioa/Services/ProjectService.cs b/zhengcaioa/Services/ProjectService.cs index e837793..37a38d7 100644 --- a/zhengcaioa/Services/ProjectService.cs +++ b/zhengcaioa/Services/ProjectService.cs @@ -92,6 +92,9 @@ updateproject.Dailiname = project.Dailiname; updateproject.Dailicontact = project.Dailicontact; updateproject.Dailiaddress = project.Dailiaddress; + updateproject.Fencha = project.Fencha; + updateproject.Shuliang = updateproject.Shuliang; + } //瀛愯〃 @@ -292,7 +295,7 @@ List<ProjectDTO> list = new List<ProjectDTO>(); //绛涢�� StringBuilder sql = new StringBuilder(); - sql.Append("SELECT distinct a.[Id],a.[start_time],a.[drhx_defen],a.[dshx_defen] ,b.[name] +'-'+c.[name]+'-'+d.[name] Sheng ,a.city ,a.[area_id],a.cgfs, a.[name] ,a.[number],a.creater,a.createtime,a.modifier,a.modifytime ,a.[drhx],a.[drhx_price],a.[dshx],a.[dshx_price],a.[remark],a.[rec_status] ,a.[question] ,a.[zhongbiaocishu],a.[feibiaocishu],a.[zhongbiaojine],a.[Fblx],a.[Fbyy] , a.[zhuanjia] , a.[caigourenname], a.[caigourenaddress], a.[caigourencontact], a.[dailiname], a.[dailiaddress], a.[dailicontact] ,toubiaocishu = stuff((select '銆�'+ f.[names] from [Projectzhongbiao] f where f.[ProjectId] = a.[Id] for xml path('')), 1,1, '') "); //zhuanjia = stuff((select ','+name from [Zhuanjia] f where CHARINDEX(f.id,a.[zhuanjia]) >0 for xml path('')), 1,1, '') + sql.Append("SELECT distinct a.[Id],a.[start_time],a.[drhx_defen],a.[dshx_defen] ,b.[name] +'-'+c.[name]+'-'+d.[name] Sheng ,a.city ,a.[area_id],a.cgfs, a.[name] ,a.[number],a.creater,a.createtime,a.modifier,a.modifytime ,a.[drhx],a.[drhx_price],a.[dshx],a.[dshx_price],a.[Fencha],a.[Shuliang],a.[remark],a.[rec_status] ,a.[question] ,a.[zhongbiaocishu],a.[feibiaocishu],a.[zhongbiaojine],a.[Fblx],a.[Fbyy] , a.[zhuanjia] , a.[caigourenname], a.[caigourenaddress], a.[caigourencontact], a.[dailiname], a.[dailiaddress], a.[dailicontact] ,toubiaocishu = stuff((select '銆�'+ f.[names] from [Projectzhongbiao] f where f.[ProjectId] = a.[Id] for xml path('')), 1,1, '') "); //zhuanjia = stuff((select ','+name from [Zhuanjia] f where CHARINDEX(f.id,a.[zhuanjia]) >0 for xml path('')), 1,1, '') sql.Append("FROM [Project] a "); sql.Append("left join [Area] b on a.[sheng] = b.[codeID] "); sql.Append("left join [Area] c on a.[city] = c.[codeID] "); @@ -330,8 +333,46 @@ sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (b.[defen]-a.[drhx_defen]) <= " + aaaa + " ) "); } } + if (!string.IsNullOrWhiteSpace(searchEntity.Baojiachaxiaoyu)) + { + decimal aaaa = 0; + decimal.TryParse(searchEntity.Baojiachaxiaoyu, out aaaa); + if (aaaa > 0) + { + sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (convert(numeric(10,2),b.[price] )-convert(numeric(10,2),a.[drhx_price] )) <= " + aaaa + " ) "); + } + } + - if (!string.IsNullOrWhiteSpace(searchEntity.Reasonname)) + if (!string.IsNullOrWhiteSpace(searchEntity.Fenchadayu)) + { + decimal aaaa = 0; + decimal.TryParse(searchEntity.Fenchadayu, out aaaa); + if (aaaa > 0) + { + sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (b.[defen]-a.[drhx_defen]) >= " + aaaa + " ) "); + } + } + + if (!string.IsNullOrWhiteSpace(searchEntity.Shuliang)) + { + decimal aaaa = 0; + decimal.TryParse(searchEntity.Shuliang, out aaaa); + if (aaaa > 0) + { + sql.Append(" and exists ( select * from( select ( isnull((select COUNT(*) ProjectIdshuliang from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] group by b.ProjectId) ,0)+ "); + + sql.Append(" isnull( (select COUNT(*) ProjectIdshuliang from [Projectreason] b where a.[Id]=b.[ProjectId] group by b.ProjectId),0)+ "); + sql.Append(" isnull( (select COUNT(*) ProjectIdshuliang from [Projectyouxiao] b where a.[Id]=b.[ProjectId] group by b.ProjectId),0)+ "); + sql.Append(" isnull( ( select COUNT(*) ProjectIdshuliang from [Project] b where a.[Id]=b.[Id] and b.drhx is not null ),0)+ "); + sql.Append(" isnull( (select COUNT(*) ProjectIdshuliang from [Project] b where a.[Id]=b.[Id] and b.dshx is not null ),0) "); + sql.Append(" ) as sum_count ) a where a.sum_count <= " + aaaa + ""); + sql.Append(" ) "); + } + } + + + if (!string.IsNullOrWhiteSpace(searchEntity.Reasonname)) { sql.Append(" and exists (select b.[ProjectId] from [Projectreason] b where a.[Id]=b.[ProjectId] and b.[reasonname] like '%" + searchEntity.Reasonname + "%') "); @@ -389,9 +430,19 @@ } + if (!string.IsNullOrWhiteSpace(searchEntity.Caigourenname)) + { + sql.Append("and a.[caigourenname] like '%" + searchEntity.Caigourenname.Trim().Replace("'", "''") + "%'"); + + } + + if (!string.IsNullOrWhiteSpace(searchEntity.Dailiname)) + { + sql.Append("and a.[dailiname] like '%" + searchEntity.Dailiname.Trim().Replace("'", "''") + "%'"); + + } - if (!string.IsNullOrWhiteSpace(searchEntity.Sheng)) { -- Gitblit v1.9.1