perf: 流水线支持名称模糊查询

This commit is contained in:
xiaojunnuo
2024-08-04 02:35:45 +08:00
parent a9717b9a0d
commit 59897c4cea
14 changed files with 157 additions and 28 deletions
@@ -118,10 +118,9 @@ export abstract class BaseService<T> {
}
const qb = this.getRepository().createQueryBuilder('main');
if (order && order.prop) {
qb.orderBy('main.' + order.prop, order.asc ? 'ASC' : 'DESC');
} else {
qb.orderBy('id', 'DESC');
qb.addOrderBy('main.' + order.prop, order.asc ? 'ASC' : 'DESC');
}
qb.addOrderBy('id', 'DESC');
qb.offset(page.offset).limit(page.limit);
//根据bean query
if (query) {
@@ -9,12 +9,7 @@ export abstract class CrudController<T> extends BaseController {
@Body(ALL)
body
) {
const pageRet = await this.getService().page(
body?.query,
body?.page,
body?.sort,
null
);
const pageRet = await this.getService().page(body?.query, body?.page, body?.sort, null);
return this.ok(pageRet);
}
@@ -54,6 +49,7 @@ export abstract class CrudController<T> extends BaseController {
await this.getService().update(bean);
return this.ok(null);
}
@Post('/delete')
async delete(
@Query('id')