fix 072
This commit is contained in:
parent
c1599e9d41
commit
54b06e6f9a
1 changed files with 8 additions and 22 deletions
|
|
@ -963,7 +963,7 @@ export class ProfileController extends Controller {
|
|||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. OrgRevision");
|
||||
}
|
||||
|
||||
const findPosMaster = await AppDataSource.getRepository(PosMaster)
|
||||
const [findPosMaster, total] = await AppDataSource.getRepository(PosMaster)
|
||||
.createQueryBuilder("posMaster")
|
||||
.leftJoinAndSelect("posMaster.current_holder", "current_holder")
|
||||
.leftJoinAndSelect("posMaster.orgRoot", "orgRoot")
|
||||
|
|
@ -1014,9 +1014,10 @@ export class ProfileController extends Controller {
|
|||
keyword: `%${body.keyword}%`,
|
||||
},
|
||||
)
|
||||
|
||||
.orWhere(
|
||||
body.keyword != null && body.keyword != ""
|
||||
? "orgRoot.orgRootName LIKE :keyword"
|
||||
? "current_holder.citizenId LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${body.keyword}%`,
|
||||
|
|
@ -1024,7 +1025,7 @@ export class ProfileController extends Controller {
|
|||
)
|
||||
.orWhere(
|
||||
body.keyword != null && body.keyword != ""
|
||||
? "orgChild1.orgChild1Name LIKE :keyword"
|
||||
? "posType.posTypeName LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${body.keyword}%`,
|
||||
|
|
@ -1032,23 +1033,7 @@ export class ProfileController extends Controller {
|
|||
)
|
||||
.orWhere(
|
||||
body.keyword != null && body.keyword != ""
|
||||
? "orgChild2.orgChild2Name LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${body.keyword}%`,
|
||||
},
|
||||
)
|
||||
.orWhere(
|
||||
body.keyword != null && body.keyword != ""
|
||||
? "orgChild3.orgChild3Name LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${body.keyword}%`,
|
||||
},
|
||||
)
|
||||
.orWhere(
|
||||
body.keyword != null && body.keyword != ""
|
||||
? "orgChild4.orgChild4Name LIKE :keyword"
|
||||
? "posLevel.posLevelName LIKE :keyword"
|
||||
: "1=1",
|
||||
{
|
||||
keyword: `%${body.keyword}%`,
|
||||
|
|
@ -1056,13 +1041,14 @@ export class ProfileController extends Controller {
|
|||
)
|
||||
}),
|
||||
)
|
||||
.skip((body.page - 1) * body.pageSize)
|
||||
.take(body.pageSize)
|
||||
.getMany();
|
||||
.getManyAndCount();
|
||||
if (!findPosMaster) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "not found. PosMaster");
|
||||
}
|
||||
|
||||
const total = findPosMaster?findPosMaster.length:0;
|
||||
|
||||
const formattedData = findPosMaster.map((item) => {
|
||||
let orgShortName = "";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue