wangzhibo
2026-07-18 708f980f0f351bfe47d7936151bf52ed4d4a7bc4
src/modules/basicdata/controller/admin/iot.ts
@@ -3,6 +3,7 @@
import { BasicdataIotEntity } from '../../entity/iot';
import { BasicdataIotService } from '../../service/iot';
import { BaseSysDepartmentEntity } from '../../../base/entity/sys/department';
import { WithDeptFilterWhere } from '../../../base/middleware/with-dept-filter-where'
/**
 * 数据源定义信息后台管理
@@ -23,6 +24,15 @@
        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 AdminBasicdataIotController extends BaseController {