feat(M08-B): 补保洁员资料管理
This commit is contained in:
@@ -66,6 +66,7 @@ export class UserManagementRepository {
|
||||
page: number;
|
||||
pageSize: number;
|
||||
status?: 'ACTIVE' | 'DISABLED';
|
||||
role?: AssignableRole;
|
||||
search?: string;
|
||||
}): Promise<{ items: ManagedUser[]; total: number }> {
|
||||
const filters = ['u.tenant_id = ?', 'u.deleted_at IS NULL'];
|
||||
@@ -74,6 +75,15 @@ export class UserManagementRepository {
|
||||
filters.push('u.status = ?');
|
||||
params.push(input.status);
|
||||
}
|
||||
if (input.role) {
|
||||
filters.push(`EXISTS (
|
||||
SELECT 1 FROM qipai_user_roles fur
|
||||
INNER JOIN qipai_roles fr ON fr.tenant_id = fur.tenant_id AND fr.id = fur.role_id
|
||||
WHERE fur.tenant_id = u.tenant_id AND fur.user_id = u.id
|
||||
AND fr.code = ? AND fr.status = 'ACTIVE' AND fr.deleted_at IS NULL
|
||||
)`);
|
||||
params.push(input.role);
|
||||
}
|
||||
if (input.search) {
|
||||
filters.push('(u.nickname LIKE ? OR u.phone LIKE ? OR CAST(u.id AS CHAR) = ?)');
|
||||
const like = `%${input.search}%`;
|
||||
|
||||
Reference in New Issue
Block a user