From 482a07ac087a25f4bd43182f40fb72c4e611fa8d Mon Sep 17 00:00:00 2001 From: liguoyang Date: Tue, 27 Aug 2024 17:11:18 +0800 Subject: [PATCH] =?UTF-8?q?fix=20sql=E7=94=9F=E6=88=90=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Organization/Services/Implements/GainfoService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs index af58a4b7..556095ab 100644 --- a/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs +++ b/Src/Dlhis.Basic/Organization/Services/Implements/GainfoService.cs @@ -80,11 +80,11 @@ public class GainfoService : IGainfoService ISugarQueryable queryable = request.IsSearchAll ? _gainfoStore.Queryable(request.Status) + .LeftJoin((gainfo, department) => gainfo.DepartmentNo == department.No) + .LeftJoin((gainfo, department, type) => type.Code == SqlFunc.ToString(gainfo.CardType) && type.Type == "timeperiod") .WhereIF(request.DepartmentSelections?.Any() == true, where) .WhereIF(request.DepartmentSelections?.Any() == false, gainfo => factories.Contains(gainfo.Factory) || SqlFunc.Subqueryable().Where(p => p.Code == gainfo.Code && factories.Contains(p.Destination) && SqlFunc.DateIsSame(p.BeginDate, today)).Any()) - .LeftJoin((gainfo, department) => gainfo.DepartmentNo == department.No) - .LeftJoin((gainfo, department, type) => type.Code == SqlFunc.ToString(gainfo.CardType) && type.Type == "timeperiod") .WhereIF(request.Search.IsPresent(), gainfo => gainfo.Name.Contains(request.Search) || gainfo.Code == request.Search