|
|
|
@ -1283,12 +1283,22 @@ namespace Shentun.Peis.CustomerReports |
|
|
|
public async Task<List<GetAsbitemSpecificResultReportDto>> GetAsbitemSpecificResultReportAsync(GetAsbitemSpecificResultReportRequestDto input) |
|
|
|
{ |
|
|
|
|
|
|
|
//var query = from a in await _patientRegisterRepository.GetQueryableAsync()
|
|
|
|
// join b in await _patientRepository.GetQueryableAsync() on a.PatientId equals b.Id into bb
|
|
|
|
// from ab in bb.DefaultIfEmpty()
|
|
|
|
// join d in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals d.PatientRegisterId
|
|
|
|
// join e in await _asbitemRepository.GetQueryableAsync() on d.AsbitemId equals e.Id
|
|
|
|
// join c in await _registerCheckRepository.GetQueryableAsync() on d.RegisterCheckId equals c.Id
|
|
|
|
// join g in await _sexRepository.GetQueryableAsync() on a.SexId equals g.Id into gg
|
|
|
|
// from ag in gg.DefaultIfEmpty()
|
|
|
|
// select new { a, ab, c, d, ag, e };
|
|
|
|
|
|
|
|
var query = from a in await _patientRegisterRepository.GetQueryableAsync() |
|
|
|
join b in await _patientRepository.GetQueryableAsync() on a.PatientId equals b.Id into bb |
|
|
|
from ab in bb.DefaultIfEmpty() |
|
|
|
join d in await _registerAsbitemRepository.GetQueryableAsync() on a.Id equals d.PatientRegisterId |
|
|
|
join c in await _registerCheckRepository.GetQueryableAsync() on a.Id equals c.PatientRegisterId |
|
|
|
join d in await _registerAsbitemRepository.GetQueryableAsync() on c.Id equals d.RegisterCheckId |
|
|
|
join e in await _asbitemRepository.GetQueryableAsync() on d.AsbitemId equals e.Id |
|
|
|
join c in await _registerCheckRepository.GetQueryableAsync() on d.RegisterCheckId equals c.Id |
|
|
|
join g in await _sexRepository.GetQueryableAsync() on a.SexId equals g.Id into gg |
|
|
|
from ag in gg.DefaultIfEmpty() |
|
|
|
select new { a, ab, c, d, ag, e }; |
|
|
|
@ -1314,7 +1324,7 @@ namespace Shentun.Peis.CustomerReports |
|
|
|
var CustomerOrgIds = await _customerOrgManager.GetCustomerOrgChildrenId(item.CustomerOrgId.Value); |
|
|
|
sumquery = sumquery.Where(m => CustomerOrgIds.Contains(m.a.CustomerOrgId)); |
|
|
|
} |
|
|
|
if (item.DateType != null && !string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) |
|
|
|
if (!string.IsNullOrEmpty(item.StartDate) && !string.IsNullOrEmpty(item.EndDate)) |
|
|
|
{ |
|
|
|
if (item.DateType == '1') |
|
|
|
{ |
|
|
|
@ -1388,6 +1398,10 @@ namespace Shentun.Peis.CustomerReports |
|
|
|
|
|
|
|
sumquery = sumquery.Where(m => input.AsbitemId.Contains(m.d.AsbitemId)); |
|
|
|
|
|
|
|
if (input.CompleteFlag != null) |
|
|
|
{ |
|
|
|
sumquery = sumquery.Where(m => m.c.CompleteFlag == input.CompleteFlag); |
|
|
|
} |
|
|
|
|
|
|
|
if (sumquery.Any()) |
|
|
|
{ |
|
|
|
|