Files
brapi-java/docs/dev/04-germplasm/09-germplasm_attribute_value.md
2026-05-28 17:25:32 +08:00

44 lines
1.7 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 04 Germplasm / Seed - germplasm_attribute_value 表录入说明
来源:`docs/architecture/04-germplasm-seed-data-flow.md`
## 录入目标
`germplasm_attribute_value` 保存某个 germplasm 在某个属性定义上的实际取值。
## 上下游关系
| 类型 | 内容 |
| --- | --- |
| 表 | `germplasm_attribute_value` |
| Java 实体 | `GermplasmAttributeValueEntity` |
| 前置依赖 | `germplasm``germplasm_attribute_definition` |
| 下游引用 | 属性查询、详情展示 |
| API | `/brapi/v2/attributevalues` |
## 字段录入
| 字段 | 业务意义 | 录入方式 | 校验规则 |
| --- | --- | --- | --- |
| `id` | 属性值主键 | 系统生成;导入可指定 | 必填、唯一 |
| `auth_user_id` | 数据所属用户 | 登录上下文自动写入 | 不允许前端手填 |
| `germplasm_id` | 所属 germplasm | Germplasm 选择器/详情页带出 | 必选,必须存在 |
| `attribute_id` | 属性定义 | Attribute 选择器 | 必选,必须存在 |
| `value` | 属性值 | 根据 definition.datatype 选择控件 | 必填或按业务要求 |
| `determined_date` | 测定日期 | 日期选择器 | 可选 |
## 页面与交互
- 在 Germplasm 详情页 Attributes Tab 维护。
- 批量导入时按 germplasm + attribute 组成矩阵录入更高效。
## 关键校验
1. `germplasm_id``attribute_id` 必须存在。
2. 同一 germplasm 下同一 attribute 不建议重复,若允许多次测定,需要用 determined_date 区分。
3. `value` 必须符合 attribute definition 的 datatype。
---
**状态:已完成**(与第二章 `02-germplasm-seed/04-germplasm_attribute_value.md` 共用实现,页面:`germplasm` → Attribute Values Tab