Files
brapi-java/docs/dev/04-germplasm/12-cross_parent.md
2026-05-28 11:56:17 +08:00

40 lines
1.6 KiB
Markdown
Raw 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 - cross_parent 表录入说明
来源:`docs/architecture/04-germplasm-seed-data-flow.md`
## 录入目标
`cross_parent` 连接 cross 与亲本来源。亲本可以是 germplasm也可以是 observation_unit用来表达实际田间单株或 plot 来源。
## 上下游关系
| 类型 | 内容 |
| --- | --- |
| 表 | `cross_parent` |
| Java 实体 | `CrossParentEntity` |
| 前置依赖 | `cross_entity``crossing_project``germplasm``observation_unit` |
| 下游引用 | 杂交亲本展示和校验 |
## 字段录入
| 字段 | 业务意义 | 录入方式 | 校验规则 |
| --- | --- | --- | --- |
| `id` | cross parent 主键 | 系统生成 | 必填、唯一 |
| `cross_id` | 所属 cross | Cross 选择器/详情页带出 | 必选,必须存在 |
| `crossing_project_id` | 所属 crossing project | 自动带出/选择器 | 建议与 cross 一致 |
| `germplasm_id` | 亲本 germplasm | Germplasm 选择器 | 与 observation_unit 至少填一个 |
| `observation_unit_id` | 亲本 observation unit | ObservationUnit 选择器 | 与 germplasm 至少填一个 |
| `parent_type` | 亲本类型 | 枚举选择 | FEMALE、MALE、SELF、POPULATION、CLONAL 等 |
## 页面与交互
- 在 Cross 或 PlannedCross 详情页 Parents Tab 内维护。
- 创建 cross 时至少添加一个亲本;常见杂交需要 FEMALE 和 MALE。
## 关键校验
1. `cross_id` 必须存在。
2. `germplasm_id``observation_unit_id` 至少填写一个,不建议同时为空。
3. 同一 cross 下相同 parentType + germplasm/observationUnit 不应重复。
4. 如果填 `crossing_project_id`,应与 `cross.crossing_project_id` 一致。