v3_1
This commit is contained in:
@@ -276,11 +276,22 @@ func (q *Queries) ListSysUserByIds(ctx context.Context, dollar_1 []int32) ([]*Sy
|
||||
}
|
||||
|
||||
const listSysUserCondition = `-- name: ListSysUserCondition :many
|
||||
SELECT id, uuid, email, username, avatar, gender, department_id, role_id, status, change_password_at, created_at, updated_at,
|
||||
(SELECT name FROM sys_department WHERE ID = sys_user.department_id) AS department_name,
|
||||
(SELECT display_name
|
||||
FROM sys_role
|
||||
WHERE id = sys_user.role_id) AS role_name
|
||||
SELECT id,
|
||||
uuid,
|
||||
email,
|
||||
username,
|
||||
avatar,
|
||||
gender,
|
||||
department_id,
|
||||
role_id,
|
||||
status,
|
||||
change_password_at,
|
||||
created_at,
|
||||
updated_at,
|
||||
COALESCE((SELECT name FROM sys_department WHERE ID = sys_user.department_id), '') AS department_name,
|
||||
COALESCE((SELECT display_name
|
||||
FROM sys_role
|
||||
WHERE id = sys_user.role_id), '') AS role_name
|
||||
FROM sys_user
|
||||
WHERE (NOT $1::Boolean OR sys_user.status = $2)
|
||||
AND (NOT $3::Boolean OR sys_user.id = $4)
|
||||
@@ -303,20 +314,20 @@ type ListSysUserConditionParams struct {
|
||||
}
|
||||
|
||||
type ListSysUserConditionRow struct {
|
||||
ID int32 `json:"id"`
|
||||
Uuid uuid.UUID `json:"uuid"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
Gender int32 `json:"gender"`
|
||||
DepartmentID int32 `json:"department_id"`
|
||||
RoleID int32 `json:"role_id"`
|
||||
Status int32 `json:"status"`
|
||||
ChangePasswordAt time.Time `json:"change_password_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DepartmentName string `json:"department_name"`
|
||||
RoleName string `json:"role_name"`
|
||||
ID int32 `json:"id"`
|
||||
Uuid uuid.UUID `json:"uuid"`
|
||||
Email string `json:"email"`
|
||||
Username string `json:"username"`
|
||||
Avatar string `json:"avatar"`
|
||||
Gender int32 `json:"gender"`
|
||||
DepartmentID int32 `json:"department_id"`
|
||||
RoleID int32 `json:"role_id"`
|
||||
Status int32 `json:"status"`
|
||||
ChangePasswordAt time.Time `json:"change_password_at"`
|
||||
CreatedAt time.Time `json:"created_at"`
|
||||
UpdatedAt time.Time `json:"updated_at"`
|
||||
DepartmentName interface{} `json:"department_name"`
|
||||
RoleName interface{} `json:"role_name"`
|
||||
}
|
||||
|
||||
func (q *Queries) ListSysUserCondition(ctx context.Context, arg *ListSysUserConditionParams) ([]*ListSysUserConditionRow, error) {
|
||||
|
||||
Reference in New Issue
Block a user