fix sql生成结构
This commit is contained in:
@@ -80,11 +80,11 @@ public class GainfoService : IGainfoService
|
||||
|
||||
ISugarQueryable<GainfoPageResponse> queryable = request.IsSearchAll
|
||||
? _gainfoStore.Queryable(request.Status)
|
||||
.LeftJoin<DepartmentEntity>((gainfo, department) => gainfo.DepartmentNo == department.No)
|
||||
.LeftJoin<BasicTypeEntity>((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<BusinessTripEntity>().Where(p => p.Code == gainfo.Code && factories.Contains(p.Destination) && SqlFunc.DateIsSame(p.BeginDate, today)).Any())
|
||||
.LeftJoin<DepartmentEntity>((gainfo, department) => gainfo.DepartmentNo == department.No)
|
||||
.LeftJoin<BasicTypeEntity>((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
|
||||
|
||||
Reference in New Issue
Block a user