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

主附表,多主键,新主键无法展示 #7627

Open
pftz opened this issue Dec 20, 2024 · 4 comments
Open

主附表,多主键,新主键无法展示 #7627

pftz opened this issue Dec 20, 2024 · 4 comments

Comments

@pftz
Copy link

pftz commented Dec 20, 2024

版本号:

3。7.2

问题描述:

我配置了一个主附表,主表中除了id是主键外,还有一个人员编号也是主键,在附表中配置一个外键,这个外键的对应的是主表中人员编号这个字段的值,但配置完成后在附表中外键展示的值是主表的id的值,而不是人员编号这个主键的值

错误截图:

友情提示:

  • 未按格式要求发帖、描述过于简单的,会被直接删掉;
  • 描述问题请图文并茂,方便我们理解并快速定位问题;
  • 如果使用的不是master,请说明你使用的分支;
@zhangdaiscott
Copy link
Member

啥意思,新主键无法展示是什么意思

@pftz
Copy link
Author

pftz commented Dec 20, 2024

如下图中上面井的信息是主表,下面的历史数据的井名为对应主表的外键,下表中展示的外键的值不是井的名称,而是展示井信息的id的值

截屏2024-12-20 16 50 57

@zhangdaiscott
Copy link
Member

a) 子表引用主表主键ID作为外键,外键字段必须以_ID结尾,例如 ORDER_ID
b) 主表和子表的外键字段名字,必须相同(除主键ID外);

https://help.jeecg.com/java/onlinedaimashengchengyiduiduo.html

@pftz
Copy link
Author

pftz commented Dec 22, 2024

子表引用的主表主键不是ID作为外键,外键字段也还是必须以_ID结尾吗?
截屏2024-12-22 19 04 14
图一是主表的数据库属性
<img width="1210" alt="截屏2024-12-22 19 04 30" src="https://github.com/user-attachments/assets/079cffdd-439c-4d63-a014-0
截屏2024-12-22 19 04 39
136b787fc09" />

图二是子表的数据库属性
图三是子表的外键信息;
需要怎么修改

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants