480 Star 4.4K Fork 1.6K

ssssssss-team / magic-api

 / 详情

db.camel().table()使用exclude()排除名称包含多个单词的字段失效

Done
Opened this issue  
2023-02-27 11:39

当前使用版本(必填,否则不予处理)

2.0.2

该问题是怎么引起的?

简单分析,发现因为table()未指定字段名,构建SQL时使用select * from ...; 而如果指定了camel(), 则exclue('userName')方法保存下来的excludeColumns中是user_name, 而SQLModule.queryForList方法中最后通过remove('user_name')来进行排除,就失效了。
同样问题应该会出现在类似的 pasal(), upper(), lower()情形

重现步骤(如果有就写完整)

  1. 假设有一sys_user表,包含字段 user_id, user_name, password 等
  2. 执行 db.camel().table('sys_user').exclude('user_name').page(); 或 db.camel().table('sys_user').exclude('userName').page();
  3. 返回结果中依然会出现 user_name 字段内容。

报错信息

Comments (0)

larkworm created任务
小东 through ssssssss-team/magic-api Commit 1c152d6 changed issue state from 待办的 to 已完成
Expand operation logs

Sign in to comment

Status
Assignees
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
参与者(1)
55151 larkworm 1578915689
Java
1
https://gitee.com/ssssssss-team/magic-api.git
git@gitee.com:ssssssss-team/magic-api.git
ssssssss-team
magic-api
magic-api

Search