This commit is contained in:
2025-03-31 11:59:42 +08:00
parent 963e1e005e
commit 6fb06c456c
52 changed files with 2244 additions and 753 deletions

View File

@@ -4,6 +4,8 @@ type SearchDto struct {
SearchTimeBegin string `json:"searchTimeBegin"`
SearchTimeEnd string `json:"searchTimeEnd"`
SearchStatus int `json:"searchStatus"`
SearchEmail string `json:"searchEmail"`
SearchPhone string `json:"searchPhone"`
SearchName string `json:"searchName"`
SearchID int64 `json:"searchID"`
SearchKey string `json:"searchKey"`

View File

@@ -6,10 +6,11 @@ INSERT INTO sys_role (
parent_id,
parent_path,
status,
sort,
created_at,
updated_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8
$1, $2, $3, $4, $5, $6, $7, $8, $9
) RETURNING *;
-- name: UpdateSysRole :one

View File

@@ -51,7 +51,9 @@ ORDER BY created_at DESC;
-- name: CountSysUserCondition :one
SELECT COUNT(*) FROM sys_user
WHERE (NOT @is_status::Boolean OR status = @status)
AND (@username::text = '' OR username ILIKE '%' || @username || '%');
AND (NOT @is_id::Boolean OR id = @id)
AND (@username::text = '' OR username ILIKE '%' || @username || '%')
AND (@email::text = '' OR email ILIKE '%' || @email || '%');
-- name: ListSysUserCondition :many
SELECT id, uuid, email, username, avatar, gender, department_id, role_id, status, change_password_at, created_at, updated_at,
@@ -61,7 +63,9 @@ SELECT id, uuid, email, username, avatar, gender, department_id, role_id, status
WHERE id = sys_user.role_id) AS role_name
FROM sys_user
WHERE (NOT @is_status::Boolean OR sys_user.status = @status)
AND (@username::text = '' OR username ILIKE '%' || @username || '%')
AND (NOT @is_id::Boolean OR sys_user.id = @id)
AND (@username::text = '' OR sys_user.username ILIKE '%' || @username || '%')
AND (@email::text = '' OR sys_user.email ILIKE '%' || @email || '%')
ORDER BY created_at DESC
OFFSET @skip
LIMIT @size;

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: budget.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: categroy.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: customer.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: expenses.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: income.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: project.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: project_file.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_audit_log.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_config.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_department.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_menu.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_role.sql
package db
@@ -100,10 +100,11 @@ INSERT INTO sys_role (
parent_id,
parent_path,
status,
sort,
created_at,
updated_at
) VALUES (
$1, $2, $3, $4, $5, $6, $7, $8
$1, $2, $3, $4, $5, $6, $7, $8, $9
) RETURNING id, name, display_name, parent_id, parent_path, vip, status, sort, created_at, updated_at
`
@@ -114,6 +115,7 @@ type CreateSysRoleParams struct {
ParentID int32 `json:"parent_id"`
ParentPath string `json:"parent_path"`
Status int32 `json:"status"`
Sort int32 `json:"sort"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
@@ -126,6 +128,7 @@ func (q *Queries) CreateSysRole(ctx context.Context, arg *CreateSysRoleParams) (
arg.ParentID,
arg.ParentPath,
arg.Status,
arg.Sort,
arg.CreatedAt,
arg.UpdatedAt,
)

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_role_menu.sql
package db

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_user.sql
package db
@@ -27,17 +27,29 @@ func (q *Queries) CountSysUser(ctx context.Context) (int64, error) {
const countSysUserCondition = `-- name: CountSysUserCondition :one
SELECT COUNT(*) FROM sys_user
WHERE (NOT $1::Boolean OR status = $2)
AND ($3::text = '' OR username ILIKE '%' || $3 || '%')
AND (NOT $3::Boolean OR id = $4)
AND ($5::text = '' OR username ILIKE '%' || $5 || '%')
AND ($6::text = '' OR email ILIKE '%' || $6 || '%')
`
type CountSysUserConditionParams struct {
IsStatus bool `json:"is_status"`
Status int32 `json:"status"`
IsID bool `json:"is_id"`
ID int32 `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
}
func (q *Queries) CountSysUserCondition(ctx context.Context, arg *CountSysUserConditionParams) (int64, error) {
row := q.db.QueryRow(ctx, countSysUserCondition, arg.IsStatus, arg.Status, arg.Username)
row := q.db.QueryRow(ctx, countSysUserCondition,
arg.IsStatus,
arg.Status,
arg.IsID,
arg.ID,
arg.Username,
arg.Email,
)
var count int64
err := row.Scan(&count)
return count, err
@@ -271,16 +283,21 @@ SELECT id, uuid, email, username, avatar, gender, department_id, role_id, status
WHERE id = sys_user.role_id) AS role_name
FROM sys_user
WHERE (NOT $1::Boolean OR sys_user.status = $2)
AND ($3::text = '' OR username ILIKE '%' || $3 || '%')
AND (NOT $3::Boolean OR sys_user.id = $4)
AND ($5::text = '' OR sys_user.username ILIKE '%' || $5 || '%')
AND ($6::text = '' OR sys_user.email ILIKE '%' || $6 || '%')
ORDER BY created_at DESC
OFFSET $4
LIMIT $5
OFFSET $7
LIMIT $8
`
type ListSysUserConditionParams struct {
IsStatus bool `json:"is_status"`
Status int32 `json:"status"`
IsID bool `json:"is_id"`
ID int32 `json:"id"`
Username string `json:"username"`
Email string `json:"email"`
Skip int32 `json:"skip"`
Size int32 `json:"size"`
}
@@ -306,7 +323,10 @@ func (q *Queries) ListSysUserCondition(ctx context.Context, arg *ListSysUserCond
rows, err := q.db.Query(ctx, listSysUserCondition,
arg.IsStatus,
arg.Status,
arg.IsID,
arg.ID,
arg.Username,
arg.Email,
arg.Skip,
arg.Size,
)

View File

@@ -1,6 +1,6 @@
// Code generated by sqlc. DO NOT EDIT.
// versions:
// sqlc v1.27.0
// sqlc v1.28.0
// source: sys_user_login_log.sql
package db