no message

This commit is contained in:
Kittapath 2024-03-04 09:43:02 +07:00
parent 432c3f6851
commit 5f97ab1ac7
3 changed files with 10 additions and 9 deletions

View file

@ -1066,6 +1066,7 @@ export class PositionController extends Controller {
.leftJoinAndSelect("posMaster.orgChild4", "orgChild4")
.leftJoinAndSelect("posMaster.current_holder", "current_holder")
.leftJoinAndSelect("posMaster.next_holder", "next_holder")
.leftJoinAndSelect("posMaster.orgRevision", "orgRevision")
.where(conditions)
.orWhere(
new Brackets((qb) => {
@ -1085,7 +1086,7 @@ export class PositionController extends Controller {
new Brackets((qb) => {
qb.andWhere(
body.keyword != null && body.keyword != ""
? `CONCAT(current_holder.prefix, current_holder.firstName, current_holder.lastName) like '%${body.keyword}%'`
? `CASE WHEN orgRevision.orgRevisionIsDraft = true THEN CONCAT(next_holder.prefix, next_holder.firstName,' ', next_holder.lastName) ELSE CONCAT(current_holder.prefix, current_holder.firstName,' ' , current_holder.lastName) END LIKE '%${body.keyword}%'`
: "1=1",
{
keyword: `%${body.keyword}%`,

View file

@ -384,7 +384,7 @@ export class ProfileController extends Controller {
.andWhere(
new Brackets((qb) => {
qb.where("next_holders.id IS NULL").orWhere("next_holders.id NOT IN (:...ids)", {
ids: orgRevision.posMasters.map((x) => x.id),
ids: orgRevision.posMasters.map((x) => x.next_holderId),
});
}),
)

View file

@ -79,25 +79,25 @@ export class PosDict extends EntityBase {
export class CreatePosDict {
@Column()
posDictName: string;
posDictName: string | null;
@Column()
posDictField: string;
posDictField: string | null;
@Column("uuid")
posTypeId: string;
posTypeId: string | null;
@Column("uuid")
posLevelId: string;
posLevelId: string | null;
@Column()
posExecutiveId?: string;
posExecutiveId?: string | null;
@Column()
posDictExecutiveField: string;
posDictExecutiveField: string | null;
@Column()
posDictArea: string;
posDictArea: string | null;
@Column()
isSpecial: boolean;