| | |
| | | sql.Append(" ) "); |
| | | } |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.Chuanbiaofenxi)) |
| | | { |
| | | if (searchEntity.Chuanbiaofenxi == "01") |
| | | { |
| | | sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (b.[defen]-a.[drhx_defen]) >= 10 ) "); |
| | | 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 <= 5 "); |
| | | sql.Append(" ) "); |
| | | } |
| | | else if (searchEntity.Chuanbiaofenxi == "02") |
| | | { |
| | | sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (b.[defen]-a.[drhx_defen]) >= 20 ) "); |
| | | |
| | | |
| | | } |
| | | else if (searchEntity.Chuanbiaofenxi == "03") |
| | | { |
| | | sql.Append(" and exists ( select b.[ProjectId] from [Projectzhongbiao] b where a.[Id]=b.[ProjectId] and (b.[defen]-a.[drhx_defen]) >= 10 ) "); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.Reasonname)) |
| | |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.StartTimestar)) |
| | | { |
| | | sql.Append(" and a.start_time <='" + StartTimestarend.AddDays(1).ToString("yyyy-MM-dd") + "'"); |
| | | |
| | | } |
| | | |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.KaibiaoTimeStar)) |
| | | { |
| | | sql.Append(" and a.start_time >='" + searchEntity.KaibiaoTimeStar + "'"); |
| | | |
| | | } |
| | | if (!string.IsNullOrWhiteSpace(searchEntity.KaibiaoTimeEnd)) |
| | | { |
| | | sql.Append(" and a.start_time <='" + searchEntity.KaibiaoTimeEnd + "'"); |
| | | |
| | | } |
| | | |
| | |
| | | searchEntity.totalrows = query.Count(); |
| | | var lianlist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList(); |
| | | list = _mapper.Map<List<ProjectDTO>>(lianlist); |
| | | |
| | | var cgfs = GetCgfs(); |
| | | foreach(var projectDTO in list) |
| | | { |
| | | var cgf = cgfs.Where(x=>x.Id == projectDTO.Cgfs).FirstOrDefault(); |
| | | if (cgf != null) |
| | | { |
| | | projectDTO.CgfsName = cgf.Name; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | data.LoadData(searchEntity, list); |
| | | return data; |
| | | } |