Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

添加用户后在界面不显示 #11

Open
AgnoyZ opened this issue Apr 11, 2024 · 2 comments
Open

添加用户后在界面不显示 #11

AgnoyZ opened this issue Apr 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AgnoyZ
Copy link
Collaborator

AgnoyZ commented Apr 11, 2024

查看后端代码,发现执行获取所有用户的sql语句如下
SELECT
hr.id, hr.name, hr.phone, hr.telephone, hr.address, hr.enabled, hr.username, hr.userface, hr.remark, hr.employee_id, hr.work_date, r.id as rid, r.name as rname, r.namezh as rnamezh
FROM hr left join hr_role hrr on hr.id = hrr.hrid left join role r on hrr.rid = r.id
WHERE hr.id != #{id,jdbcType=INTEGER} AND hr.employee_id is NULL

AND hr.name LIKE concat('%',#{name,jdbcType=VARCHAR},'%')

发现要求employee_id要为空,但是在hr实体类的employee_id是int类型,前端发送请求时并没有给emplyee_id赋值,导致后端执行sql语句时employee_id的值为0,而获取所有用户的sql语句的employee_id要求为空
解决办法
修改后端hr实体类employee_id的变量类型为Integer,修改get,set方法的变量类型
修改前端addHr变量的employee_id变量值置为空

@LIRUILONGS
Copy link
Owner

@AgnoyZ 方便提交 PR 嘛?

@AgnoyZ
Copy link
Collaborator Author

AgnoyZ commented Apr 12, 2024

@LIRUILONGS LIRUILONGS added the bug Something isn't working label Apr 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants