filter ประเภทลูกจ้าง
This commit is contained in:
parent
73cd6ba4eb
commit
aa7dd54230
1 changed files with 9 additions and 0 deletions
|
|
@ -199,6 +199,7 @@ export class ProfileEmployeeController extends Controller {
|
||||||
@Query() yearLeave?: number,
|
@Query() yearLeave?: number,
|
||||||
@Query() isProbation?: boolean,
|
@Query() isProbation?: boolean,
|
||||||
@Query() isRetire?: boolean,
|
@Query() isRetire?: boolean,
|
||||||
|
@Query() type?: string,
|
||||||
) {
|
) {
|
||||||
let queryLike =
|
let queryLike =
|
||||||
"CONCAT(profileEmployee.prefix, profileEmployee.firstName, ' ', profileEmployee.lastName) LIKE :keyword";
|
"CONCAT(profileEmployee.prefix, profileEmployee.firstName, ' ', profileEmployee.lastName) LIKE :keyword";
|
||||||
|
|
@ -254,6 +255,14 @@ export class ProfileEmployeeController extends Controller {
|
||||||
: `profile.dateRetire IS NOT NULL`
|
: `profile.dateRetire IS NOT NULL`
|
||||||
: "1=1",
|
: "1=1",
|
||||||
)
|
)
|
||||||
|
.andWhere(
|
||||||
|
type !== undefined && type !== null && type !== ""
|
||||||
|
? "profileEmployee.employeeClass LIKE :type"
|
||||||
|
: "1=1",
|
||||||
|
{
|
||||||
|
type: `%${type}%`,
|
||||||
|
}
|
||||||
|
)
|
||||||
.skip((page - 1) * pageSize)
|
.skip((page - 1) * pageSize)
|
||||||
.take(pageSize)
|
.take(pageSize)
|
||||||
.getManyAndCount();
|
.getManyAndCount();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue