| | |
| | | import { BasicdataBuyerEntity } from '../../entity/buyer'; |
| | | import { BasicdataBuyerService } from '../../service/buyer'; |
| | | import { BaseSysDepartmentEntity } from '../../../base/entity/sys/department'; |
| | | import { WithDeptFilterWhere } from '../../../base/middleware/with-dept-filter-where' |
| | | |
| | | /** |
| | | * 购买方管理 |
| | |
| | | service: BasicdataBuyerService, |
| | | pageQueryOp: { |
| | | fieldEq: ['a.departmentId', 'a.name', 'a.contact'], |
| | | fieldLike: ['a.name','a.address'], |
| | | fieldLike: ['a.name', 'a.address'], |
| | | select: ['a.*', 'b.name AS departmentName'], |
| | | join: [ |
| | | { |
| | |
| | | type: 'leftJoin', |
| | | }, |
| | | ], |
| | | where: async ctx => { |
| | | const conditions: any[][] = []; |
| | | conditions.push(...(await WithDeptFilterWhere(ctx, { alias: 'a', field: 'departmentId' }))); |
| | | |
| | | // 其他关联表(举例) |
| | | // conditions.push(...(await deptFilterWhere(ctx, 'd', 'id'))); |
| | | |
| | | return conditions; |
| | | }, |
| | | }, |
| | | }) |
| | | export class AdminOperationBuyerController extends BaseController {} |
| | | export class AdminOperationBuyerController extends BaseController { } |