feat(task-order): add query and filter support
This commit is contained in:
parent
87f7ecfae6
commit
e5e8737f09
1 changed files with 15 additions and 1 deletions
|
|
@ -39,9 +39,23 @@ export class TaskController extends Controller {
|
|||
|
||||
@Get()
|
||||
@Security("keycloak")
|
||||
async getTaskOrderList(@Query() query: string = "", @Query() page = 1, @Query() pageSize = 30) {
|
||||
async getTaskOrderList(
|
||||
@Query() query: string = "",
|
||||
@Query() page = 1,
|
||||
@Query() pageSize = 30,
|
||||
@Query() taskStatus?: TaskStatus,
|
||||
) {
|
||||
const [result, total] = await prisma.$transaction([
|
||||
prisma.taskOrder.findMany({
|
||||
where: {
|
||||
taskStatus,
|
||||
OR: [
|
||||
{ code: { contains: query, mode: "insensitive" } },
|
||||
{ taskName: { contains: query } },
|
||||
{ contactName: { contains: query } },
|
||||
{ contactTel: { contains: query } },
|
||||
],
|
||||
},
|
||||
include: {
|
||||
institution: true,
|
||||
acceptedBy: true,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue