|
@@ -57,9 +57,9 @@ type SysUserMapping struct {
|
|
|
SysRoleId int `description:"角色id"`
|
|
|
SysRoleName string `description:"角色名称"`
|
|
|
SysDepartmentId int `description:"所属部门id"`
|
|
|
- SysDepartmentName1 string `description:"所属部门一级"`
|
|
|
- SysDepartmentName2 string `description:"所属部门二级路径"`
|
|
|
- SysDepartmentName3 string `description:"所属部门三级路径"`
|
|
|
+ SysDepartmentName1 string `description:"所属部门一级名称"`
|
|
|
+ SysDepartmentName2 string `description:"所属部门二级名称"`
|
|
|
+ SysDepartmentName3 string `description:"所属部门三级名称"`
|
|
|
Province string `description:"省"`
|
|
|
City string `description:"市"`
|
|
|
IsEnabled bool `description:"是否启用"`
|
|
@@ -140,21 +140,13 @@ func GetSysUserCountByRoleId(roleId int) (count int, err error) {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
-func GetSysUserList(condition string, pars []interface{}, startSize, pageSize int) (items []*SysUserMapping, err error) {
|
|
|
- sql := `SELECT u.*,d1.sys_department_name sys_department_name1, d2.sys_department_name sys_department_name2, d3.sys_department_name sys_department_name3
|
|
|
- FROM sys_user u
|
|
|
- LEFT JOIN sys_department AS d1
|
|
|
- ON u.sys_department_id1 = d1.sys_department_id
|
|
|
- LEFT JOIN sys_department AS d2
|
|
|
- ON u.sys_department_id2 = d2.sys_department_id
|
|
|
- LEFT JOIN sys_department AS d3
|
|
|
- ON u.sys_department_id3 = d3.sys_department_id
|
|
|
- WHERE 1=1 `
|
|
|
+func GetSysUserList(condition string, pars []interface{}, startSize, pageSize int) (items []*SysUser, err error) {
|
|
|
+ sql := `SELECT * FROM sys_user u WHERE 1=1 `
|
|
|
if condition != "" {
|
|
|
sql += condition
|
|
|
}
|
|
|
- sql += `ORDER BY u.is_enabled, u.modify_time DESC LIMIT ?,?`
|
|
|
- o := orm.NewOrmUsingDB("master")
|
|
|
+ sql += ` ORDER BY u.is_enabled, u.modify_time DESC LIMIT ?,?`
|
|
|
+ o := orm.NewOrm()
|
|
|
_, err = o.Raw(sql, pars, startSize, pageSize).QueryRows(&items)
|
|
|
return
|
|
|
}
|