ให้ออกลูกจ้าง
Some checks failed
release-dev / release-dev (push) Failing after 11s

This commit is contained in:
kittapath 2025-01-27 10:14:54 +07:00
parent 8a3baab88f
commit 87e8c17309
9 changed files with 19456 additions and 68 deletions

View file

@ -243,6 +243,7 @@ namespace BMA.EHR.Application.Repositories
{ {
try try
{ {
Console.WriteLine(ocId);
var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId); var period = await _dbContext.Set<InsigniaPeriod>().FirstOrDefaultAsync(p => p.Id == periodId);
if (period == null) if (period == null)
@ -293,7 +294,6 @@ namespace BMA.EHR.Application.Repositories
Root = p.Root, Root = p.Root,
}); });
// check วันที่บรรจะต้องน้อยกว่า 29/5/ปี-8 ขอ บม. // check วันที่บรรจะต้องน้อยกว่า 29/5/ปี-8 ขอ บม.
var s1 = ((from p in inst_profile var s1 = ((from p in inst_profile
where p.ProfileDateAppoint <= new DateTime(period.Year - 8, 5, 29) where p.ProfileDateAppoint <= new DateTime(period.Year - 8, 5, 29)
@ -340,7 +340,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)", $"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
} }
})).ToList(); })).ToList();
@ -445,7 +445,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)", $"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
new MatchingCondition new MatchingCondition
{ {
@ -548,7 +548,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)", $"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับปฏิบัติการ (8,340) แต่ไม่ถึงขั้นต่ำของอัตราเงินเดือนข้าราชการพลเรือนระดับชำนาญการ (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
new MatchingCondition new MatchingCondition
{ {
@ -734,7 +734,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)", $"2.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
} }
})).ToList(); })).ToList();
@ -841,7 +841,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)", $"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
new MatchingCondition new MatchingCondition
{ {
@ -945,7 +945,7 @@ namespace BMA.EHR.Application.Repositories
{ {
Condition = Condition =
$"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)", $"1.ได้รับอัตราค่าจ้างตั้งแต่อัตราเงินเดือนขั้นต่ำของข้าราขการพลเรือนระดับชำนาญการขึ้นไป (15,050)",
Result = $"อัตราค่าจ้าง {p.SalaryCondition.Value.ToString("#,##0")}" Result = $"อัตราค่าจ้าง {p?.SalaryCondition?.ToString("#,##0")??""}"
}, },
new MatchingCondition new MatchingCondition
{ {
@ -6535,30 +6535,30 @@ namespace BMA.EHR.Application.Repositories
if (period != null && period.InsigniaEmployees != null) if (period != null && period.InsigniaEmployees != null)
{ {
allEmployeeProfileByRoot = allEmployeeProfileByRoot =
(await _userProfileRepository.GetEmployeeProfileByPositionAsync(period.InsigniaEmployees.Select(x => x.RefId), AccessToken)); (await _userProfileRepository.GetEmployeeProfileByPositionAsync(ocId, period.InsigniaEmployees.Select(x => x.RefId), AccessToken));
} }
var type_coin = await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot); var type_coin = allOfficerProfilesByRoot.Count() > 0 ? await GetCoinCandidate(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level1 = await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot); var type1_level1 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level1(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level2 = await GetInsigniaCandidate_Type1_Level2(periodId, ocId, allOfficerProfilesByRoot); var type1_level2 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level2(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level3 = await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot); var type1_level3 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level3(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type1_level4 = await GetInsigniaCandidate_Type1_Level4(periodId, ocId, allOfficerProfilesByRoot); var type1_level4 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type1_Level4(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level5 = await GetInsigniaCandidate_Type2_Level5(periodId, ocId, allOfficerProfilesByRoot); var type2_level5 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level5(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level6 = await GetInsigniaCandidate_Type2_Level6(periodId, ocId, allOfficerProfilesByRoot); var type2_level6 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level6(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level7 = await GetInsigniaCandidate_Type2_Level7(periodId, ocId, allOfficerProfilesByRoot); var type2_level7 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level7(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level8 = await GetInsigniaCandidate_Type2_Level8(periodId, ocId, allOfficerProfilesByRoot); var type2_level8 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level8(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level9_1 = var type2_level9_1 =
await GetInsigniaCandidate_Type2_Level9_1(periodId, ocId, allOfficerProfilesByRoot); allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level9_1(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type2_level9_2 = var type2_level9_2 =
await GetInsigniaCandidate_Type2_Level9_2(periodId, ocId, allOfficerProfilesByRoot); allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type2_Level9_2(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type3_level10 = await GetInsigniaCandidate_Type3_Level10(periodId, ocId, allOfficerProfilesByRoot); var type3_level10 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type3_Level10(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type3_level11 = await GetInsigniaCandidate_Type3_Level11(periodId, ocId, allOfficerProfilesByRoot); var type3_level11 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type3_Level11(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type4_level10 = await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot); var type4_level10 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type4_Level10(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var type4_level11 = await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot); var type4_level11 = allOfficerProfilesByRoot.Count() > 0 ? await GetInsigniaCandidate_Type4_Level11(periodId, ocId, allOfficerProfilesByRoot) : new List<InsigniaResultSet>();
var employee_type1 = await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot); var employee_type1 = allEmployeeProfileByRoot.Count() > 0 ? await GetEmployeeInsignia_Type1(periodId, ocId, allEmployeeProfileByRoot) : new List<InsigniaResultSet>();
var employee_type2 = await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot); var employee_type2 = allEmployeeProfileByRoot.Count() > 0 ? await GetEmployeeInsignia_Type2(periodId, ocId, allEmployeeProfileByRoot) : new List<InsigniaResultSet>();
// union result // union result
foreach (var r in type_coin) foreach (var r in type_coin)

View file

@ -129,7 +129,7 @@ namespace BMA.EHR.Application.Repositories
} }
} }
public async Task<List<GetProfileByRootIdDto>> GetEmployeeProfileByPositionAsync(dynamic empPosId, string? accessToken) public async Task<List<GetProfileByRootIdDto>> GetEmployeeProfileByPositionAsync(Guid rootId, dynamic empPosId, string? accessToken)
{ {
try try
{ {
@ -138,6 +138,7 @@ namespace BMA.EHR.Application.Repositories
var body = new var body = new
{ {
rootId,
empPosId empPosId
}; };

View file

@ -16,7 +16,7 @@ namespace BMA.EHR.Application.Requests
public int Amount { get; set; } public int Amount { get; set; }
public int Round { get; set; } public int Round { get; set; }
public List<string>? EmpPosId { get; set; } public string[] EmpPosId { get; set; }
public FormFile? File { get; set; } public FormFile? File { get; set; }
} }
} }

View file

@ -1,15 +1,13 @@
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using System.ComponentModel.DataAnnotations;
using BMA.EHR.Domain.Models.Base; using BMA.EHR.Domain.Models.Base;
using System.ComponentModel.DataAnnotations.Schema;
using BMA.EHR.Domain.Models.MetaData;
using BMA.EHR.Domain.Models.Organizations;
using BMA.EHR.Domain.Models.Documents;
namespace BMA.EHR.Domain.Models.Insignias namespace BMA.EHR.Domain.Models.Insignias
{ {
public class InsigniaEmployee : EntityBase public class InsigniaEmployee : EntityBase
{ {
[Comment("Fk Table InsigniaPeriod")]
public InsigniaPeriod InsigniaPeriod { get; set; }
[Comment("id ตำแหน่งลูกจ้าง")]
public string? RefId { get; set; } public string? RefId { get; set; }
} }
} }

View file

@ -0,0 +1,88 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace BMA.EHR.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class updatetableInsigniaPeriodaddInsigniaEmployee1 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InsigniaEmployees_InsigniaPeriods_InsigniaPeriodId",
table: "InsigniaEmployees");
migrationBuilder.AlterColumn<string>(
name: "RefId",
table: "InsigniaEmployees",
type: "longtext",
nullable: true,
comment: "id ตำแหน่งลูกจ้าง",
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true)
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "InsigniaPeriodId",
table: "InsigniaEmployees",
type: "char(36)",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)",
oldNullable: true)
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_InsigniaEmployees_InsigniaPeriods_InsigniaPeriodId",
table: "InsigniaEmployees",
column: "InsigniaPeriodId",
principalTable: "InsigniaPeriods",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_InsigniaEmployees_InsigniaPeriods_InsigniaPeriodId",
table: "InsigniaEmployees");
migrationBuilder.AlterColumn<string>(
name: "RefId",
table: "InsigniaEmployees",
type: "longtext",
nullable: true,
oldClrType: typeof(string),
oldType: "longtext",
oldNullable: true,
oldComment: "id ตำแหน่งลูกจ้าง")
.Annotation("MySql:CharSet", "utf8mb4")
.OldAnnotation("MySql:CharSet", "utf8mb4");
migrationBuilder.AlterColumn<Guid>(
name: "InsigniaPeriodId",
table: "InsigniaEmployees",
type: "char(36)",
nullable: true,
collation: "ascii_general_ci",
oldClrType: typeof(Guid),
oldType: "char(36)")
.OldAnnotation("Relational:Collation", "ascii_general_ci");
migrationBuilder.AddForeignKey(
name: "FK_InsigniaEmployees_InsigniaPeriods_InsigniaPeriodId",
table: "InsigniaEmployees",
column: "InsigniaPeriodId",
principalTable: "InsigniaPeriods",
principalColumn: "Id");
}
}
}

View file

@ -5676,7 +5676,7 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasColumnOrder(101) .HasColumnOrder(101)
.HasComment("User Id ที่สร้างข้อมูล"); .HasComment("User Id ที่สร้างข้อมูล");
b.Property<Guid?>("InsigniaPeriodId") b.Property<Guid>("InsigniaPeriodId")
.HasColumnType("char(36)"); .HasColumnType("char(36)");
b.Property<string>("LastUpdateFullName") b.Property<string>("LastUpdateFullName")
@ -5699,7 +5699,8 @@ namespace BMA.EHR.Infrastructure.Migrations
.HasComment("แก้ไขข้อมูลล่าสุดเมื่อ"); .HasComment("แก้ไขข้อมูลล่าสุดเมื่อ");
b.Property<string>("RefId") b.Property<string>("RefId")
.HasColumnType("longtext"); .HasColumnType("longtext")
.HasComment("id ตำแหน่งลูกจ้าง");
b.HasKey("Id"); b.HasKey("Id");
@ -18005,9 +18006,13 @@ namespace BMA.EHR.Infrastructure.Migrations
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaEmployee", b => modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaEmployee", b =>
{ {
b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", null) b.HasOne("BMA.EHR.Domain.Models.Insignias.InsigniaPeriod", "InsigniaPeriod")
.WithMany("InsigniaEmployees") .WithMany("InsigniaEmployees")
.HasForeignKey("InsigniaPeriodId"); .HasForeignKey("InsigniaPeriodId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("InsigniaPeriod");
}); });
modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManage", b => modelBuilder.Entity("BMA.EHR.Domain.Models.Insignias.InsigniaManage", b =>

View file

@ -241,22 +241,21 @@ namespace BMA.EHR.Insignia.Service.Controllers
LastUpdatedAt = DateTime.Now, LastUpdatedAt = DateTime.Now,
RevisionId = revisionId ?? Guid.Empty RevisionId = revisionId ?? Guid.Empty
}; };
if (req.EmpPosId != null && req.EmpPosId.Count() != 0) foreach (var item in req.EmpPosId)
{ {
foreach (var item in req.EmpPosId) var insigniaEmployee =
{ new InsigniaEmployee
period.InsigniaEmployees.Add( {
new InsigniaEmployee InsigniaPeriod = period,
{ RefId = item,
RefId = item, CreatedFullName = FullName ?? "System Administrator",
CreatedFullName = FullName ?? "System Administrator", CreatedUserId = UserId ?? "",
CreatedUserId = UserId ?? "", CreatedAt = DateTime.Now,
CreatedAt = DateTime.Now, LastUpdateFullName = FullName ?? "System Administrator",
LastUpdateFullName = FullName ?? "System Administrator", LastUpdateUserId = UserId ?? "",
LastUpdateUserId = UserId ?? "", LastUpdatedAt = DateTime.Now,
LastUpdatedAt = DateTime.Now, };
}); await _context.InsigniaEmployees.AddAsync(insigniaEmployee);
}
} }
await _context.InsigniaPeriods.AddAsync(period); await _context.InsigniaPeriods.AddAsync(period);
await _context.SaveChangesAsync(); await _context.SaveChangesAsync();
@ -358,22 +357,19 @@ namespace BMA.EHR.Insignia.Service.Controllers
uppdated.LastUpdateUserId = UserId ?? ""; uppdated.LastUpdateUserId = UserId ?? "";
uppdated.LastUpdatedAt = DateTime.Now; uppdated.LastUpdatedAt = DateTime.Now;
_context.InsigniaEmployees.RemoveRange(uppdated.InsigniaEmployees); _context.InsigniaEmployees.RemoveRange(uppdated.InsigniaEmployees);
if (req.EmpPosId != null && req.EmpPosId.Count() != 0) foreach (var item in req.EmpPosId)
{ {
foreach (var item in req.EmpPosId) uppdated.InsigniaEmployees.Add(
{ new InsigniaEmployee
uppdated.InsigniaEmployees.Add( {
new InsigniaEmployee RefId = item,
{ CreatedFullName = FullName ?? "System Administrator",
RefId = item, CreatedUserId = UserId ?? "",
CreatedFullName = FullName ?? "System Administrator", CreatedAt = DateTime.Now,
CreatedUserId = UserId ?? "", LastUpdateFullName = FullName ?? "System Administrator",
CreatedAt = DateTime.Now, LastUpdateUserId = UserId ?? "",
LastUpdateFullName = FullName ?? "System Administrator", LastUpdatedAt = DateTime.Now,
LastUpdateUserId = UserId ?? "", });
LastUpdatedAt = DateTime.Now,
});
}
} }
if (Request.Form.Files != null && Request.Form.Files.Count != 0) if (Request.Form.Files != null && Request.Form.Files.Count != 0)

View file

@ -68,8 +68,8 @@ namespace BMA.EHR.Retirement.Service.Controllers
/// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response> /// <response code="400">ค่าตัวแปรที่ส่งมาไม่ถูกต้อง</response>
/// <response code="401">ไม่ได้ Login เข้าระบบ</response> /// <response code="401">ไม่ได้ Login เข้าระบบ</response>
/// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response> /// <response code="500">เมื่อเกิดข้อผิดพลาดในการทำงาน</response>
[HttpGet()] [HttpGet("{type}")]
public async Task<ActionResult<ResponseObject>> GetListByAdmin() public async Task<ActionResult<ResponseObject>> GetListByAdmin(string type)
{ {
var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISMISS"); var getPermission = await _permission.GetPermissionAPIAsync("LIST", "SYS_DISMISS");
var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission); var jsonData = JsonConvert.DeserializeObject<JObject>(getPermission);
@ -103,6 +103,7 @@ namespace BMA.EHR.Retirement.Service.Controllers
var retirementOuts = await _context.RetirementOuts.AsQueryable() var retirementOuts = await _context.RetirementOuts.AsQueryable()
.OrderByDescending(x => x.CreatedAt) .OrderByDescending(x => x.CreatedAt)
.Where(x => x.profileType.Trim().ToUpper().Contains(type.Trim().ToUpper()))
// .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id))))) // .Where(x => rootId == "" ? true : (child1Id == "" ? x.rootOldId == rootId : (child2Id == "" ? x.child1OldId == child1Id : (child3Id == "" ? x.child2OldId == child2Id : (child4Id == "" ? x.child3OldId == child3Id : x.child4OldId == child4Id)))))
.Select(p => new .Select(p => new
{ {