diff --git a/code/fms/FMS新系统核心表结构设计.md b/code/fms/FMS新系统核心表结构设计.md index c94b3765..d1f7fd49 100644 --- a/code/fms/FMS新系统核心表结构设计.md +++ b/code/fms/FMS新系统核心表结构设计.md @@ -2,7 +2,14 @@ ## 1. 说明 -本文档给出 FMS 新系统核心平台表的 SQL Server 建表语句,范围包括元数据、动态表单、配置版本、Schema 迁移、权限、技术日志、登录日志与业务审计。 +本文档给出 FMS 新系统核心平台表的 SQL Server 建表语句,范围包括元数据中心(模块、实体、字段、关系、页面菜单、视图、表单、多语言)、Schema Compiler、权限中心、技术日志、登录日志与业务审计。 + +设计原则: + +- 业务实体(订舱、集装箱、发票等)由 Schema Compiler 根据 `s_module_entity` + `s_module_field` 生成真实物理表,本文档只定义平台核心表。 +- 实体是数据和字段的所有者,页面只是实体的一种展示方式;字段挂实体(`s_module_entity`),不挂菜单。 +- 页面和菜单合并为一条 `s_module_menu` 记录(导航节点 = 页面入口),用 `b_menu_type` 区分节点性质。 +- 元数据变更通过服务层校验后立即生效,DDL 同步执行、失败回滚,不做异步迁移任务表,也不建立配置变更集、版本快照或运行时状态表。 约定如下: @@ -12,710 +19,457 @@ - 逻辑外键必须创建必要的普通索引或唯一索引。 - 一个租户使用一个独立业务数据库,普通业务表不重复保存 `b_tenant_id` 或 `b_org_id`;集中技术日志和登录日志允许使用 `b_org_id` 标识日志来源。 - 内部主键统一使用 `bigint identity(1, 1)`,跨环境标识使用稳定的 `b_*_key`。 -- 同库内的逻辑关联 ID(例如 `b_form_id`、`b_release_id`)统一使用 `bigint`,不使用 `uniqueidentifier`。 -- 业务编号(例如 `b_change_set_no`、`b_release_no`)使用 `bigint`,由应用或数据库序列生成,不声明为 `identity`。 +- 同库内的逻辑关联 ID(例如 `b_form_id`)统一使用 `bigint`,不使用 `uniqueidentifier`。 - 时间点统一使用 `datetime2(3)`,应用层按 UTC 写入。 - 稳定业务标识统一使用 `b_*_key`,跨环境导入导出不得依赖内部 `b_id`。 - 扩展内容统一使用 `nvarchar(max)` 普通文本保存,由应用层按业务约定解析和校验,不使用 JSON 字段类型。 - 原布尔语义字段统一使用 `tinyint`,取值约定为 `0`(否)或 `1`(是)。 +- 核心业务字段使用真实数据库列,不采用全量 EAV;不设置无业务含义的通用扩展列(如 `b_bz1~n`、`mx_varchar_n`),字段必须有明确的 `b_field_key` 与语义。 - 下面的 `b_*_id`、`b_*_key` 关联均为逻辑外键,由应用服务负责校验一致性。 -本文档只定义平台核心表。海运订舱、集装箱、发票等业务实体表由 Schema Compiler 根据 `s_meta_entity`、`s_meta_field` 和 `s_meta_relation` 生成。 - ## 2. 元数据中心 ### 2.1 模块 +模块是业务能力边界,不是数据库表的别名。模块只保存身份、依赖与启用状态,不承载菜单、路由或数据源职责。 + ```sql -create table dbo.s_meta_module ( - b_id bigint identity(1, 1) not null, - b_module_key nvarchar(128) not null, - b_revision_no int not null, - b_name_key nvarchar(256) not null, - b_description nvarchar(1000) null, - b_origin nvarchar(32) not null - constraint df_s_meta_module_origin default N'platform', - b_enabled tinyint not null - constraint df_s_meta_module_enabled default 1, - b_protected tinyint not null - constraint df_s_meta_module_protected default 0, - b_dependency_text nvarchar(max) null, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_module_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_module primary key (b_id), - constraint ux_s_meta_module_key_revision unique (b_module_key, b_revision_no) +create table dbo.s_module ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_module_key nvarchar(128) not null, -- 模块稳定业务标识(如 ocean、finance、master-data) + b_name_key nvarchar(256) not null, -- 模块显示名多语言 key + b_description nvarchar(1000) null, -- 模块描述 + b_origin nvarchar(32) not null -- 来源:platform 平台内置 / tenant 租户定制 + constraint df_s_module_origin default N'platform', + b_enabled tinyint not null -- 是否启用(1启用/0停用) + constraint df_s_module_enabled default 1, + b_sort_no int not null -- 模块排序号 + constraint df_s_module_sort_no default 0, + b_icon_key nvarchar(128) null, -- 模块图标 key + b_config_text nvarchar(max) null, -- 模块扩展配置(应用自定义解析) + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module primary key (b_id), + constraint ux_s_module_key unique (b_module_key) ); -create index ix_s_meta_module_key - on dbo.s_meta_module (b_module_key, b_enabled); +create index ix_s_module_key + on dbo.s_module (b_module_key, b_enabled); ``` -### 2.2 实体 +### 2.2 模块依赖 + +模块依赖必须形成有向无环图,不允许循环依赖。 ```sql -create table dbo.s_meta_entity ( - b_id bigint identity(1, 1) not null, - b_entity_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_name_key nvarchar(256) not null, - b_description nvarchar(1000) null, - b_physical_table_name sysname not null, - b_primary_key_field nvarchar(128) not null - constraint df_s_meta_entity_primary_key_field default N'b_id', - b_delete_policy nvarchar(64) not null, - b_origin nvarchar(32) not null - constraint df_s_meta_entity_origin default N'platform', - b_enabled tinyint not null - constraint df_s_meta_entity_enabled default 1, - b_protected tinyint not null - constraint df_s_meta_entity_protected default 0, - b_required_by_code tinyint not null - constraint df_s_meta_entity_required_by_code default 0, - b_deprecated_since nvarchar(64) null, - b_removable_after_version nvarchar(64) null, - b_validator_key nvarchar(192) null, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_entity_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_entity primary key (b_id), - constraint ux_s_meta_entity_key_revision unique (b_entity_key, b_revision_no) +create table dbo.s_module_dependency ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_module_key nvarchar(128) not null, -- 依赖方模块 key(如 ocean) + b_depends_on_module_key nvarchar(128) not null, -- 被依赖模块 key(如 master-data) + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_dependency_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_dependency primary key (b_id), + constraint ux_s_module_dependency_key unique ( + b_module_key, + b_depends_on_module_key + ) ); -create index ix_s_meta_entity_module_key - on dbo.s_meta_entity (b_module_key, b_enabled); - -create index ix_s_meta_entity_physical_table_name - on dbo.s_meta_entity (b_physical_table_name); +create index ix_s_module_dependency_depends_on + on dbo.s_module_dependency (b_depends_on_module_key); ``` -### 2.3 字段 +### 2.3 实体 + +实体是数据和字段的所有者,映射一张真实物理表。页面、列表、表单都只是实体的展示方式。 ```sql -create table dbo.s_meta_field ( - b_id bigint identity(1, 1) not null, - b_entity_key nvarchar(192) not null, - b_field_key nvarchar(128) not null, - b_revision_no int not null, - b_name_key nvarchar(256) not null, - b_label nvarchar(256) not null, - b_description nvarchar(1000) null, - b_physical_column_name sysname not null, - b_data_type nvarchar(64) not null, - b_semantic_type nvarchar(128) null, - b_write_mode nvarchar(32) not null - constraint df_s_meta_field_write_mode default N'direct', - b_required tinyint not null - constraint df_s_meta_field_required default 0, - b_enabled tinyint not null - constraint df_s_meta_field_enabled default 1, - b_searchable tinyint not null - constraint df_s_meta_field_searchable default 0, - b_sortable tinyint not null - constraint df_s_meta_field_sortable default 0, - b_auditable tinyint not null - constraint df_s_meta_field_auditable default 0, - b_audit_visibility nvarchar(32) null, - b_sensitive tinyint not null - constraint df_s_meta_field_sensitive default 0, - b_max_length int null, - b_numeric_precision tinyint null, - b_numeric_scale tinyint null, - b_temporal_type nvarchar(32) null, - b_unit_key nvarchar(128) null, - b_default_value_text nvarchar(max) null, - b_aliases_text nvarchar(max) null, - b_validation_text nvarchar(max) null, - b_ai_hints_text nvarchar(max) null, - b_origin nvarchar(32) not null - constraint df_s_meta_field_origin default N'platform', - b_protected tinyint not null - constraint df_s_meta_field_protected default 0, - b_required_by_code tinyint not null - constraint df_s_meta_field_required_by_code default 0, - b_deprecated_since nvarchar(64) null, - b_removable_after_version nvarchar(64) null, - b_created_at datetime2(3) not null - constraint df_s_meta_field_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_field primary key (b_id), - constraint ux_s_meta_field_key_revision unique ( +create table dbo.s_module_entity ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_entity_key nvarchar(192) not null, -- 实体稳定业务标识(如 ocean.booking) + b_module_key nvarchar(128) not null, -- 所属模块 key + b_name_key nvarchar(256) not null, -- 实体显示名多语言 key + b_description nvarchar(1000) null, -- 实体描述 + b_physical_table sysname not null, -- 真实物理表名(如 ocean_booking) + b_delete_policy nvarchar(32) not null -- 删除策略(默认 lifecycle) + constraint df_s_module_entity_delete_policy default N'lifecycle', + b_origin nvarchar(32) not null -- 来源:platform / tenant + constraint df_s_module_entity_origin default N'platform', + b_enabled tinyint not null -- 是否启用 + constraint df_s_module_entity_enabled default 1, + b_config_text nvarchar(max) null, -- 实体扩展配置 + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_entity_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_entity primary key (b_id), + constraint ux_s_module_entity_key unique (b_entity_key) +); + +create index ix_s_module_entity_module_key + on dbo.s_module_entity (b_module_key, b_enabled); +``` + +删除策略取值(`b_delete_policy`): + +```text +restrictWhenReferenced 主数据:有引用时拒绝删除,只能停用或合并 +lifecycle 业务单据:草稿且无下游时可删,正式后只能取消/作废 +cascadeOwned 主表拥有的从数据:随主表同一事务级联删除 +hardDelete 临时记录:校验权限后直接物理删除 +``` + +### 2.4 字段 + +字段属于实体,同时携带数据库列定义、UI 行为与业务语义(供 UI 和 AI 理解)。 + +```sql +create table dbo.s_module_field ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_entity_key nvarchar(192) not null, -- 所属实体 key + b_field_key nvarchar(128) not null, -- 字段稳定业务标识(如 carrier_id) + b_name_key nvarchar(256) not null, -- 字段显示名多语言 key + b_label nvarchar(256) not null, -- 字段标签(可随时改,不改数据库) + b_description nvarchar(1000) null, -- 字段描述 + b_physical_column_name sysname not null, -- 真实数据库列名(通常与 b_field_key 相同) + b_data_type nvarchar(64) not null, -- 存储数据类型(如 varchar/decimal/datetime) + b_semantic_type nvarchar(128) null, -- 语义类型(如 email/money/phone,供 UI/AI 理解) + b_write_mode nvarchar(32) not null -- 后端写入模式(如 direct/compute/readonly) + constraint df_s_module_field_write_mode default N'direct', + b_required tinyint not null -- 是否必填 + constraint df_s_module_field_required default 0, + b_enabled tinyint not null -- 是否启用(停用则隐藏并保留数据) + constraint df_s_module_field_enabled default 1, + b_queryable tinyint not null -- 是否出现在查询条件中 + constraint df_s_module_field_queryable default 0, + b_sortable tinyint not null -- 是否可排序 + constraint df_s_module_field_sortable default 0, + b_list_visible tinyint not null -- 是否显示在固定列表组件 + constraint df_s_module_field_list_visible default 1, + b_edit_visible tinyint not null -- 是否显示在固定编辑组件 + constraint df_s_module_field_edit_visible default 1, + b_readonly tinyint not null -- 编辑组件中是否只读 + constraint df_s_module_field_readonly default 0, + b_sort_no int not null -- 列表/表单默认排序 + constraint df_s_module_field_sort_no default 0, + b_width int null, -- 列表列宽(px) + b_component_type nvarchar(64) null, -- 固定表单组件类型(input/select/date) + b_auditable tinyint not null -- 是否记录字段级审计 + constraint df_s_module_field_auditable default 0, + b_audit_visibility nvarchar(32) null, -- 审计可见性(内部/客户可见) + b_sensitive tinyint not null -- 是否敏感字段(涉及脱敏/导出控制) + constraint df_s_module_field_sensitive default 0, + b_max_length int null, -- 字符串最大长度 + b_numeric_precision tinyint null, -- 数值精度(总位数) + b_numeric_scale tinyint null, -- 数值小数位 + b_temporal_type nvarchar(32) null, -- 时间类型(如 date/datetime) + b_unit_key nvarchar(128) null, -- 计量单位 key + b_default_value_text nvarchar(max) null, -- 默认值(文本表达) + b_aliases_text nvarchar(max) null, -- 字段别名(搜索/AI 理解用) + b_validation_text nvarchar(max) null, -- 校验规则(文本表达) + b_ai_hints_text nvarchar(max) null, -- 给 AI 理解的提示信息 + b_origin nvarchar(32) not null -- 来源:platform / tenant + constraint df_s_module_field_origin default N'platform', + b_required_by_code tinyint not null -- 是否被代码强依赖 + constraint df_s_module_field_required_by_code default 0, + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_field_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_field primary key (b_id), + constraint ux_s_module_field_key unique ( b_entity_key, - b_field_key, - b_revision_no + b_field_key ) ); -create index ix_s_meta_field_entity_key - on dbo.s_meta_field (b_entity_key, b_enabled, b_field_key); +create index ix_s_module_field_entity_key + on dbo.s_module_field (b_entity_key, b_enabled, b_sort_no, b_field_key); -create index ix_s_meta_field_physical_column_name - on dbo.s_meta_field (b_entity_key, b_physical_column_name); +create index ix_s_module_field_physical_column_name + on dbo.s_module_field (b_entity_key, b_physical_column_name); ``` -### 2.4 实体关系 +写入模式取值(`b_write_mode`): + +```text +direct 可通过 saveobjt 普通保存(如备注、ETD、件数) +createOnly 仅创建时允许写入(如来源系统、初始业务类型) +readOnly 前端和普通接口只读(如汇总金额、关联展示值) +computed 由公式或计算服务生成(如毛利、计费重量) +actionOnly 只能通过指定业务动作修改(如审核状态、确认时间) +system 仅平台内部维护(如创建人、版本、流水状态) +``` + +### 2.5 关系 + +`b_relation` 描述实体之间的引用与主子关系,通用运行时据此执行外键校验、主子事务、级联删除和子表区域渲染。 ```sql -create table dbo.s_meta_relation ( - b_id bigint identity(1, 1) not null, - b_relation_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_source_entity_key nvarchar(192) not null, - b_source_field_key nvarchar(128) null, - b_target_entity_key nvarchar(192) not null, - b_target_field_key nvarchar(128) not null - constraint df_s_meta_relation_target_field_key default N'b_id', - b_relation_type nvarchar(32) not null, - b_ownership_type nvarchar(32) not null, - b_required tinyint not null - constraint df_s_meta_relation_required default 0, - b_delete_policy nvarchar(32) not null, - b_save_policy nvarchar(32) not null, - b_sort_field_key nvarchar(128) null, - b_unique_rule_text nvarchar(max) null, - b_enabled tinyint not null - constraint df_s_meta_relation_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_relation_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_relation primary key (b_id), - constraint ux_s_meta_relation_key_revision unique ( - b_relation_key, - b_revision_no +create table dbo.s_module_relation ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_relation_key nvarchar(192) not null, -- 关系稳定业务标识 + b_entity_key nvarchar(192) not null, -- 主实体 key + b_relation_type nvarchar(32) not null, -- 关系类型:one-to-one/one-to-many/many-to-one/many-to-many + b_target_entity_key nvarchar(192) not null, -- 目标实体 key + b_ownership nvarchar(32) not null -- 所有权(默认 reference 引用) + constraint df_s_module_relation_ownership default N'reference', + b_required tinyint not null -- 是否必填 + constraint df_s_module_relation_required default 0, + b_delete_policy nvarchar(32) null, -- 删除策略:restrict/set-null/cascade/archive + b_save_strategy nvarchar(32) null, -- 保存策略:separate 独立保存 / with-parent 随主实体事务保存 + b_order_field nvarchar(256) null, -- 子表排序字段表达式 + b_unique_constraint tinyint not null -- 是否唯一约束 + constraint df_s_module_relation_unique_constraint default 0, + b_name_key nvarchar(256) not null, -- 关系显示名多语言 key + b_enabled tinyint not null -- 是否启用 + constraint df_s_module_relation_enabled default 1, + b_config_text nvarchar(max) null, -- 关系扩展配置 + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_relation_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_relation primary key (b_id), + constraint ux_s_module_relation_key unique (b_relation_key) +); + +create index ix_s_module_relation_entity_key + on dbo.s_module_relation (b_entity_key, b_enabled); + +create index ix_s_module_relation_target_entity_key + on dbo.s_module_relation (b_target_entity_key); +``` + +### 2.6 页面菜单入口 + +每条菜单记录同时代表一个导航节点和一个页面入口。`directory` 仅表示目录节点,`page` 使用固定 Vue 页面组件,`data_category` 表示数据目录,`data` 表示由通用列表与表单组件维护的数据模块,`external` 表示外链。 + +```sql +create table dbo.s_module_menu ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_menu_key nvarchar(192) not null, -- 菜单/页面稳定业务标识 + b_module_key nvarchar(128) null, -- 所属平台模块 key + b_parent_menu_key nvarchar(192) null, -- 父菜单 key(导航树自引用) + b_name_key nvarchar(256) not null, -- 菜单显示名多语言 key + b_menu_type nvarchar(32) not null, -- 菜单类型:directory/page/data_category/data/external + b_route nvarchar(256) null, -- 固定页面或外链路由 + b_entity_key nvarchar(192) null, -- data 类型绑定的实体 key + b_view_key nvarchar(192) null, -- 绑定的列表视图 key + b_form_key nvarchar(192) null, -- 绑定的表单 key + b_permission_key nvarchar(192) null, -- 页面访问权限 key + b_icon_key nvarchar(128) null, -- 菜单图标 key + b_sort_no int not null -- 菜单排序号 + constraint df_s_module_menu_sort_no default 0, + b_can_menu tinyint not null -- 是否显示在菜单中 + constraint df_s_module_menu_can_menu default 1, + b_enabled tinyint not null -- 是否启用 + constraint df_s_module_menu_enabled default 1, + b_config_text nvarchar(max) null, -- 菜单/页面扩展配置 + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_menu_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_menu primary key (b_id), + constraint ux_s_module_menu_key unique (b_menu_key) +); + +create index ix_s_module_menu_module_key + on dbo.s_module_menu (b_module_key, b_enabled); + +create index ix_s_module_menu_parent_key + on dbo.s_module_menu (b_parent_menu_key, b_sort_no, b_enabled); + +create index ix_s_module_menu_route + on dbo.s_module_menu (b_route, b_enabled); + +create index ix_s_module_menu_entity_key + on dbo.s_module_menu (b_entity_key, b_enabled); +``` + +约束由元数据校验器执行:`directory` 节点不能填写业务表或外链路由;`page` 节点必须填写 `b_route`,并绑定 `b_view_key`/`b_form_key`;`data` 节点必须填写 `b_entity_key` 和 `b_view_key`(列表)、`b_form_key`(表单);`external` 节点必须填写 `b_route` 和 `b_permission_key`。固定页面组件负责布局,表中只保存实体与视图/表单引用和导航配置。目录仅在至少存在一个可访问子页面时显示。 + +### 2.7 视图(列表) + +视图定义"一个实体的一种列表展示方式",一个实体可以有多个视图。列表字段配置在 `s_module_view_field`。 + +```sql +create table dbo.s_module_view ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_view_key nvarchar(192) not null, -- 视图稳定业务标识(如 ocean.booking.default-list) + b_entity_key nvarchar(192) not null, -- 所属实体 key + b_name_key nvarchar(256) not null, -- 视图显示名多语言 key + b_queryable tinyint not null -- 是否提供查询条件区 + constraint df_s_module_view_queryable default 1, + b_exportable tinyint not null -- 是否允许导出 + constraint df_s_module_view_exportable default 1, + b_page_size int null, -- 默认分页大小 + b_config_text nvarchar(max) null, -- 视图扩展配置 + b_enabled tinyint not null -- 是否启用 + constraint df_s_module_view_enabled default 1, + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_view_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_view primary key (b_id), + constraint ux_s_module_view_key unique (b_view_key) +); + +create index ix_s_module_view_entity_key + on dbo.s_module_view (b_entity_key, b_enabled); + +create table dbo.s_module_view_field ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_view_key nvarchar(192) not null, -- 所属视图 key + b_field_key nvarchar(128) not null, -- 引用的字段 key + b_sort_no int not null -- 列排序号 + constraint df_s_module_view_field_sort_no default 0, + b_width int null, -- 列宽(px) + b_visible tinyint not null -- 是否显示 + constraint df_s_module_view_field_visible default 1, + b_frozen tinyint not null -- 是否固定列 + constraint df_s_module_view_field_frozen default 0, + b_align nvarchar(16) null, -- 对齐方式(left/center/right) + b_format_text nvarchar(256) null, -- 显示格式(如日期、千分位) + b_queryable tinyint not null -- 是否作为查询条件 + constraint df_s_module_view_field_queryable default 0, + b_query_operator nvarchar(32) null, -- 查询运算符(eq/contains/gte/...) + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_view_field_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_view_field primary key (b_id), + constraint ux_s_module_view_field_key unique ( + b_view_key, + b_field_key ) ); -create index ix_s_meta_relation_source_entity_key - on dbo.s_meta_relation (b_source_entity_key, b_enabled); - -create index ix_s_meta_relation_target_entity_key - on dbo.s_meta_relation (b_target_entity_key, b_enabled); +create index ix_s_module_view_field_view_key + on dbo.s_module_view_field (b_view_key, b_sort_no); ``` -### 2.5 字典与字典项 +### 2.8 表单 + +表单定义"一个实体的一种编辑展示方式",一个实体可以有多个表单(默认编辑表单、详情表单)。子表区域通过 `s_module_form_relation` 引用关系并绑定子表视图/表单。 ```sql -create table dbo.s_meta_dictionary ( - b_id bigint identity(1, 1) not null, - b_dictionary_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_name_key nvarchar(256) not null, - b_description nvarchar(1000) null, - b_enabled tinyint not null - constraint df_s_meta_dictionary_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_dictionary_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_dictionary primary key (b_id), - constraint ux_s_meta_dictionary_key_revision unique ( - b_dictionary_key, - b_revision_no +create table dbo.s_module_form ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_form_key nvarchar(192) not null, -- 表单稳定业务标识(如 ocean.booking.default-form) + b_entity_key nvarchar(192) not null, -- 所属实体 key + b_name_key nvarchar(256) not null, -- 表单显示名多语言 key + b_form_type nvarchar(32) not null -- 表单类型(默认 default) + constraint df_s_module_form_form_type default N'default', + b_config_text nvarchar(max) null, -- 表单扩展配置(控件特有属性与布局 JSON) + b_enabled tinyint not null -- 是否启用 + constraint df_s_module_form_enabled default 1, + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_form_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_form primary key (b_id), + constraint ux_s_module_form_key unique (b_form_key) +); + +create index ix_s_module_form_entity_key + on dbo.s_module_form (b_entity_key, b_enabled); + +create table dbo.s_module_form_field ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_form_key nvarchar(192) not null, -- 所属表单 key + b_field_key nvarchar(128) not null, -- 引用的字段 key + b_group_key nvarchar(128) null, -- 所属分组 key(逻辑分组) + b_sort_no int not null -- 表单内排序号 + constraint df_s_module_form_field_sort_no default 0, + b_required tinyint not null -- 是否必填(覆盖字段默认) + constraint df_s_module_form_field_required default 0, + b_readonly tinyint not null -- 是否只读(覆盖字段默认) + constraint df_s_module_form_field_readonly default 0, + b_visible tinyint not null -- 是否显示 + constraint df_s_module_form_field_visible default 1, + b_span int null, -- 布局占宽(栅格) + b_component_type nvarchar(64) null, -- 控件类型(覆盖字段默认) + b_config_text nvarchar(max) null, -- 控件扩展配置 + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_form_field_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_form_field primary key (b_id), + constraint ux_s_module_form_field_key unique ( + b_form_key, + b_field_key ) ); -create table dbo.s_meta_dictionary_item ( - b_id bigint identity(1, 1) not null, - b_dictionary_id bigint not null, - b_item_key nvarchar(128) not null, - b_item_value nvarchar(512) not null, - b_name_key nvarchar(256) not null, - b_sort_no int not null - constraint df_s_meta_dictionary_item_sort_no default 0, - b_enabled tinyint not null - constraint df_s_meta_dictionary_item_enabled default 1, - b_config_text nvarchar(max) null, - constraint pk_s_meta_dictionary_item primary key (b_id), - constraint ux_s_meta_dictionary_item_key unique ( - b_dictionary_id, - b_item_key +create index ix_s_module_form_field_form_key + on dbo.s_module_form_field (b_form_key, b_sort_no); + +create table dbo.s_module_form_relation ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_form_key nvarchar(192) not null, -- 所属表单 key + b_relation_key nvarchar(192) not null, -- 引用的主子关系 key + b_child_view_key nvarchar(192) null, -- 子表列表配置 key + b_child_form_key nvarchar(192) null, -- 子表编辑配置 key(可选) + b_display_mode nvarchar(16) not null -- 子表显示模式(默认 table) + constraint df_s_module_form_relation_display_mode default N'table', + b_editable tinyint not null -- 是否可编辑 + constraint df_s_module_form_relation_editable default 1, + b_allow_add tinyint not null -- 是否允许新增行 + constraint df_s_module_form_relation_allow_add default 1, + b_allow_delete tinyint not null -- 是否允许删除行 + constraint df_s_module_form_relation_allow_delete default 1, + b_allow_sort tinyint not null -- 是否允许排序行 + constraint df_s_module_form_relation_allow_sort default 1, + b_sort_no int not null -- 子表区域排序号 + constraint df_s_module_form_relation_sort_no default 0, + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_form_relation_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_form_relation primary key (b_id), + constraint ux_s_module_form_relation_key unique ( + b_form_key, + b_relation_key ) ); -create index ix_s_meta_dictionary_item_dictionary_id - on dbo.s_meta_dictionary_item (b_dictionary_id, b_enabled, b_sort_no); +create index ix_s_module_form_relation_form_key + on dbo.s_module_form_relation (b_form_key, b_sort_no); ``` -### 2.6 注册查询资源 +### 2.9 多语言 + +多语言是元数据运行时的一部分,统一解析模块、菜单、实体、字段、动作和主数据的显示名称。 ```sql -create table dbo.s_meta_query_source ( - b_id bigint identity(1, 1) not null, - b_query_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_name_key nvarchar(256) not null, - b_source_type nvarchar(32) not null, - b_entity_key nvarchar(192) null, - b_statement_text nvarchar(max) null, - b_parameter_schema_text nvarchar(max) null, - b_output_schema_text nvarchar(max) null, - b_permission_key nvarchar(192) null, - b_timeout_seconds int not null - constraint df_s_meta_query_source_timeout_seconds default 30, - b_max_rows int not null - constraint df_s_meta_query_source_max_rows default 1000, - b_enabled tinyint not null - constraint df_s_meta_query_source_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_query_source_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_query_source primary key (b_id), - constraint ux_s_meta_query_source_key_revision unique ( - b_query_key, - b_revision_no - ) -); - -create index ix_s_meta_query_source_module_key - on dbo.s_meta_query_source (b_module_key, b_enabled); -``` - -### 2.7 页面与菜单 - -页面是可访问的业务入口,负责把运行时视图、表单或特殊 Vue 组件绑定到稳定路由和页面权限。菜单是页面和模块的导航表现,可以配置目录、页面和外链,但不能替代页面访问权限判断。 - -```sql -create table dbo.s_meta_page ( - b_id bigint identity(1, 1) not null, - b_page_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_name_key nvarchar(256) not null, - b_page_type nvarchar(32) not null, - b_route nvarchar(256) not null, - b_component_key nvarchar(192) null, - b_view_key nvarchar(192) null, - b_form_key nvarchar(192) null, - b_permission_key nvarchar(192) not null, - b_visible tinyint not null - constraint df_s_meta_page_visible default 1, - b_enabled tinyint not null - constraint df_s_meta_page_enabled default 1, - b_protected tinyint not null - constraint df_s_meta_page_protected default 0, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_page_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_page primary key (b_id), - constraint ux_s_meta_page_key_revision unique (b_page_key, b_revision_no) -); - -create index ix_s_meta_page_module_key - on dbo.s_meta_page (b_module_key, b_enabled); - -create index ix_s_meta_page_route - on dbo.s_meta_page (b_route, b_enabled); - -create table dbo.s_meta_menu ( - b_id bigint identity(1, 1) not null, - b_menu_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_parent_menu_key nvarchar(192) null, - b_name_key nvarchar(256) not null, - b_menu_type nvarchar(32) not null, - b_page_key nvarchar(192) null, - b_route nvarchar(256) null, - b_permission_key nvarchar(192) null, - b_icon_key nvarchar(128) null, - b_sort_no int not null - constraint df_s_meta_menu_sort_no default 0, - b_visible tinyint not null - constraint df_s_meta_menu_visible default 1, - b_enabled tinyint not null - constraint df_s_meta_menu_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_menu_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_menu primary key (b_id), - constraint ux_s_meta_menu_key_revision unique (b_menu_key, b_revision_no) -); - -create index ix_s_meta_menu_parent_key - on dbo.s_meta_menu (b_parent_menu_key, b_sort_no, b_enabled); - -create index ix_s_meta_menu_page_key - on dbo.s_meta_menu (b_page_key, b_enabled); -``` - -约束由元数据校验器执行:`directory` 菜单不能绑定页面或路由,`page` 菜单必须绑定 `b_page_key`,`external` 菜单必须填写 `b_route` 和 `b_permission_key`;内部页面菜单的路由必须从页面资源解析,不能单独维护第二份内部路由,权限默认继承所绑定页面的 `b_permission_key`。目录仅在至少存在一个可访问子页面时显示。 - -### 2.8 列表与详情视图 - -```sql -create table dbo.s_meta_view ( - b_id bigint identity(1, 1) not null, - b_view_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_entity_key nvarchar(192) not null, - b_name_key nvarchar(256) not null, - b_view_type nvarchar(32) not null, - b_query_source_key nvarchar(192) null, - b_page_size int not null - constraint df_s_meta_view_page_size default 50, - b_enabled tinyint not null - constraint df_s_meta_view_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_view_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_view primary key (b_id), - constraint ux_s_meta_view_key_revision unique (b_view_key, b_revision_no) -); - -create table dbo.s_meta_view_field ( - b_id bigint identity(1, 1) not null, - b_view_id bigint not null, - b_field_key nvarchar(128) not null, - b_sort_no int not null - constraint df_s_meta_view_field_sort_no default 0, - b_visible tinyint not null - constraint df_s_meta_view_field_visible default 1, - b_width int null, - b_min_width int null, - b_fixed_position nvarchar(16) null, - b_sortable tinyint not null - constraint df_s_meta_view_field_sortable default 0, - b_filterable tinyint not null - constraint df_s_meta_view_field_filterable default 0, - b_formatter_key nvarchar(128) null, - b_align_type nvarchar(16) null, - b_config_text nvarchar(max) null, - constraint pk_s_meta_view_field primary key (b_id), - constraint ux_s_meta_view_field_key unique (b_view_id, b_field_key) -); - -create index ix_s_meta_view_entity_key - on dbo.s_meta_view (b_entity_key, b_view_type, b_enabled); - -create index ix_s_meta_view_field_view_id - on dbo.s_meta_view_field (b_view_id, b_sort_no); -``` - -### 2.9 动态表单与主子表区域 - -```sql -create table dbo.s_meta_form ( - b_id bigint identity(1, 1) not null, - b_form_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_entity_key nvarchar(192) not null, - b_name_key nvarchar(256) not null, - b_form_type nvarchar(32) not null - constraint df_s_meta_form_form_type default N'edit', - b_column_count tinyint not null - constraint df_s_meta_form_column_count default 2, - b_enabled tinyint not null - constraint df_s_meta_form_enabled default 1, - b_layout_text nvarchar(max) null, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_form_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_form primary key (b_id), - constraint ux_s_meta_form_key_revision unique (b_form_key, b_revision_no) -); - -create table dbo.s_meta_form_field ( - b_id bigint identity(1, 1) not null, - b_form_id bigint not null, - b_field_key nvarchar(128) not null, - b_group_key nvarchar(128) null, - b_row_no int not null, - b_column_no tinyint not null, - b_column_span tinyint not null - constraint df_s_meta_form_field_column_span default 1, - b_sort_no int not null - constraint df_s_meta_form_field_sort_no default 0, - b_component_type nvarchar(64) not null, - b_visible tinyint not null - constraint df_s_meta_form_field_visible default 1, - b_readonly tinyint not null - constraint df_s_meta_form_field_readonly default 0, - b_required_override tinyint null, - b_label_position nvarchar(16) null, - b_component_props_text nvarchar(max) null, - b_validation_text nvarchar(max) null, - b_config_text nvarchar(max) null, - constraint pk_s_meta_form_field primary key (b_id), - constraint ux_s_meta_form_field_key unique (b_form_id, b_field_key) -); - -create table dbo.s_meta_form_relation ( - b_id bigint identity(1, 1) not null, - b_form_id bigint not null, - b_relation_key nvarchar(192) not null, - b_group_key nvarchar(128) null, - b_child_view_key nvarchar(192) not null, - b_child_form_key nvarchar(192) null, - b_display_mode nvarchar(32) not null - constraint df_s_meta_form_relation_display_mode default N'table', - b_row_no int not null, - b_column_no tinyint not null - constraint df_s_meta_form_relation_column_no default 1, - b_column_span tinyint not null - constraint df_s_meta_form_relation_column_span default 2, - b_sort_no int not null - constraint df_s_meta_form_relation_sort_no default 0, - b_editable tinyint not null - constraint df_s_meta_form_relation_editable default 1, - b_allow_add tinyint not null - constraint df_s_meta_form_relation_allow_add default 1, - b_allow_delete tinyint not null - constraint df_s_meta_form_relation_allow_delete default 1, - b_allow_sort tinyint not null - constraint df_s_meta_form_relation_allow_sort default 0, - b_min_rows int null, - b_max_rows int null, - b_config_text nvarchar(max) null, - constraint pk_s_meta_form_relation primary key (b_id), - constraint ux_s_meta_form_relation_key unique (b_form_id, b_relation_key) -); - -create index ix_s_meta_form_entity_key - on dbo.s_meta_form (b_entity_key, b_form_type, b_enabled); - -create index ix_s_meta_form_field_form_id - on dbo.s_meta_form_field (b_form_id, b_row_no, b_column_no, b_sort_no); - -create index ix_s_meta_form_relation_form_id - on dbo.s_meta_form_relation (b_form_id, b_row_no, b_column_no, b_sort_no); -``` - -### 2.10 业务动作 - -```sql -create table dbo.s_meta_action ( - b_id bigint identity(1, 1) not null, - b_action_key nvarchar(192) not null, - b_revision_no int not null, - b_module_key nvarchar(128) not null, - b_entity_key nvarchar(192) null, - b_name_key nvarchar(256) not null, - b_action_type nvarchar(32) not null, - b_handler_key nvarchar(192) null, - b_permission_key nvarchar(192) not null, - b_input_schema_text nvarchar(max) null, - b_output_schema_text nvarchar(max) null, - b_precondition_text nvarchar(max) null, - b_audit_event_key nvarchar(192) null, - b_confirmation_mode nvarchar(32) null, - b_idempotency_required tinyint not null - constraint df_s_meta_action_idempotency_required default 1, - b_enabled tinyint not null - constraint df_s_meta_action_enabled default 1, - b_config_text nvarchar(max) null, - b_created_at datetime2(3) not null - constraint df_s_meta_action_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_action primary key (b_id), - constraint ux_s_meta_action_key_revision unique (b_action_key, b_revision_no) -); - -create index ix_s_meta_action_entity_key - on dbo.s_meta_action (b_entity_key, b_enabled); - -create index ix_s_meta_action_permission_key - on dbo.s_meta_action (b_permission_key); -``` - -### 2.11 多语言 - -```sql -create table dbo.s_meta_i18n ( - b_id bigint identity(1, 1) not null, - b_resource_key nvarchar(256) not null, - b_locale nvarchar(32) not null, - b_revision_no int not null, - b_resource_value nvarchar(max) not null, - b_source_type nvarchar(32) not null - constraint df_s_meta_i18n_source_type default N'manual', - b_resource_status nvarchar(32) not null - constraint df_s_meta_i18n_resource_status default N'confirmed', - b_model_key nvarchar(128) null, - b_created_at datetime2(3) not null - constraint df_s_meta_i18n_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_i18n primary key (b_id), - constraint ux_s_meta_i18n_key_locale_revision unique ( +create table dbo.s_module_i18n ( + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_resource_key nvarchar(256) not null, -- 多语言资源 key(如 nameKey) + b_locale nvarchar(32) not null, -- 语言区域(如 zh-CN/en-US) + b_resource_value nvarchar(max) not null, -- 该语言下的显示文本 + b_source_type nvarchar(32) not null -- 来源类型(默认 manual 人工 / ai AI 生成) + constraint df_s_module_i18n_source_type default N'manual', + b_resource_status nvarchar(32) not null -- 资源状态(默认 confirmed 已确认) + constraint df_s_module_i18n_resource_status default N'confirmed', + b_model_key nvarchar(128) null, -- 生成翻译的 AI 模型标识(追溯用) + b_created_at datetime2(3) not null -- 创建时间(UTC) + constraint df_s_module_i18n_created_at default sysutcdatetime(), + b_created_by nvarchar(128) not null, -- 创建人 + constraint pk_s_module_i18n primary key (b_id), + constraint ux_s_module_i18n_key_locale unique ( b_resource_key, - b_locale, - b_revision_no + b_locale ) ); -create index ix_s_meta_i18n_resource_key - on dbo.s_meta_i18n (b_resource_key, b_locale); +create index ix_s_module_i18n_resource_key + on dbo.s_module_i18n (b_resource_key, b_locale); ``` -## 3. 配置版本与 Schema Compiler +## 3. Schema Compiler -### 3.1 配置变更集 +元数据变更通过服务层校验后立即生效。Schema Compiler 根据 `s_module_entity` 的物理表配置和 `s_module_field` 的物理字段配置生成所需的 `CREATE TABLE`、`ALTER TABLE`、索引和约束语句,并由应用服务直接执行;执行成功后提交元数据变更,失败则回滚本次操作并返回错误。 -```sql -create table dbo.s_meta_change_set ( - b_id bigint identity(1, 1) not null, - b_change_set_no bigint not null, - b_base_release_id bigint null, - b_operation_type nvarchar(32) not null, - b_reason nvarchar(1000) null, - b_change_text nvarchar(max) not null, - b_ddl_plan_text nvarchar(max) null, - b_validation_text nvarchar(max) null, - b_impact_text nvarchar(max) null, - b_checksum varchar(128) not null, - b_execution_status nvarchar(32) not null, - b_created_at datetime2(3) not null - constraint df_s_meta_change_set_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - b_completed_at datetime2(3) null, - b_error_code nvarchar(128) null, - b_error_message nvarchar(2000) null, - constraint pk_s_meta_change_set primary key (b_id), - constraint ux_s_meta_change_set_no unique (b_change_set_no) -); +执行机制: -create index ix_s_meta_change_set_base_release_id - on dbo.s_meta_change_set (b_base_release_id); - -create index ix_s_meta_change_set_execution_status - on dbo.s_meta_change_set (b_execution_status, b_created_at); -``` - -### 3.2 不可变配置版本 - -```sql -create table dbo.s_meta_release ( - b_id bigint identity(1, 1) not null, - b_release_no bigint not null, - b_change_set_id bigint not null, - b_checksum varchar(128) not null, - b_validation_status nvarchar(32) not null, - b_description nvarchar(1000) null, - b_created_at datetime2(3) not null - constraint df_s_meta_release_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_meta_release primary key (b_id), - constraint ux_s_meta_release_no unique (b_release_no), - constraint ux_s_meta_release_checksum unique (b_checksum) -); - -create table dbo.s_meta_release_resource ( - b_id bigint identity(1, 1) not null, - b_release_id bigint not null, - b_resource_type nvarchar(64) not null, - b_resource_key nvarchar(256) not null, - b_resource_id bigint not null, - b_resource_revision_no int not null, - b_checksum varchar(128) not null, - constraint pk_s_meta_release_resource primary key (b_id), - constraint ux_s_meta_release_resource_key unique ( - b_release_id, - b_resource_type, - b_resource_key - ) -); - -create index ix_s_meta_release_resource_release_id - on dbo.s_meta_release_resource (b_release_id, b_resource_type); - -create index ix_s_meta_release_resource_resource_id - on dbo.s_meta_release_resource (b_resource_id); -``` - -### 3.3 当前运行版本与激活历史 - -```sql -create table dbo.s_meta_runtime_state ( - b_id bigint identity(1, 1) not null, - b_state_key nvarchar(64) not null - constraint df_s_meta_runtime_state_state_key default N'default', - b_current_release_id bigint not null, - b_updated_at datetime2(3) not null - constraint df_s_meta_runtime_state_updated_at default sysutcdatetime(), - b_updated_by nvarchar(128) not null, - b_row_version rowversion not null, - constraint pk_s_meta_runtime_state primary key (b_id), - constraint ux_s_meta_runtime_state_key unique (b_state_key) -); - -create table dbo.s_meta_release_activation ( - b_id bigint identity(1, 1) not null, - b_release_id bigint not null, - b_previous_release_id bigint null, - b_activation_type nvarchar(32) not null, - b_reason nvarchar(1000) null, - b_request_id nvarchar(128) null, - b_trace_id nvarchar(128) null, - b_activated_at datetime2(3) not null - constraint df_s_meta_release_activation_activated_at default sysutcdatetime(), - b_activated_by nvarchar(128) not null, - constraint pk_s_meta_release_activation primary key (b_id) -); - -create index ix_s_meta_release_activation_release_id - on dbo.s_meta_release_activation (b_release_id, b_activated_at desc); -``` - -### 3.4 Schema 迁移任务与步骤 - -```sql -create table dbo.s_schema_migration ( - b_id bigint identity(1, 1) not null, - b_change_set_id bigint not null, - b_target_release_id bigint null, - b_migration_status nvarchar(32) not null, - b_lock_owner nvarchar(128) null, - b_lock_expires_at datetime2(3) null, - b_plan_checksum varchar(128) not null, - b_current_step_no int null, - b_started_at datetime2(3) null, - b_completed_at datetime2(3) null, - b_created_at datetime2(3) not null - constraint df_s_schema_migration_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - b_error_code nvarchar(128) null, - b_error_message nvarchar(2000) null, - constraint pk_s_schema_migration primary key (b_id), - constraint ux_s_schema_migration_change_set_id unique (b_change_set_id) -); - -create table dbo.s_schema_migration_step ( - b_id bigint identity(1, 1) not null, - b_migration_id bigint not null, - b_step_no int not null, - b_step_type nvarchar(32) not null, - b_object_key nvarchar(256) null, - b_statement_text nvarchar(max) null, - b_rollback_statement_text nvarchar(max) null, - b_checksum varchar(128) not null, - b_step_status nvarchar(32) not null, - b_started_at datetime2(3) null, - b_completed_at datetime2(3) null, - b_result_text nvarchar(max) null, - b_error_message nvarchar(2000) null, - constraint pk_s_schema_migration_step primary key (b_id), - constraint ux_s_schema_migration_step_no unique (b_migration_id, b_step_no) -); - -create index ix_s_schema_migration_status - on dbo.s_schema_migration (b_migration_status, b_created_at); - -create index ix_s_schema_migration_step_migration_id - on dbo.s_schema_migration_step (b_migration_id, b_step_status, b_step_no); -``` +- DDL 同步执行,单租户库内加锁,同一时间只允许一个结构变更任务;其他租户不受影响。 +- 每个变更步骤记录开始时间、结束时间、checksum 和执行结果;重启或网络中断后可以从最后一个已确认步骤继续执行。 +- DDL、数据转换和结构校验全部成功后,才提交元数据变更;提交失败保持原结构,进入可修复状态。 +- 变更审计统一写入现有审计日志;本阶段不建立配置变更集、版本快照或迁移任务表,如果未来需要异步执行、失败重试、断点恢复或版本回滚,再增加专用任务表。 +- 破坏性变更(删除字段、缩短长度、改变类型)采用 expand-contract:先新增兼容结构、双写或分批迁移数据、校验新旧数据、停止写入旧结构、经过保留期后归档或删除旧结构。 ## 4. 统一权限中心 @@ -723,35 +477,34 @@ create index ix_s_schema_migration_step_migration_id ```sql create table dbo.s_auth_role ( - b_id bigint identity(1, 1) not null, - b_role_key nvarchar(128) not null, - b_role_name nvarchar(256) not null, - b_description nvarchar(1000) null, - b_role_type nvarchar(32) not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_role_key nvarchar(128) not null, -- 角色稳定业务标识 + b_role_name nvarchar(256) not null, -- 角色名称 + b_description nvarchar(1000) null, -- 角色描述 + b_role_type nvarchar(32) not null -- 角色类型(默认 custom 自定义) constraint df_s_auth_role_role_type default N'custom', - b_enabled tinyint not null + b_enabled tinyint not null -- 是否启用 constraint df_s_auth_role_enabled default 1, - b_created_at datetime2(3) not null + b_created_at datetime2(3) not null -- 创建时间(UTC) constraint df_s_auth_role_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - b_updated_at datetime2(3) null, - b_updated_by nvarchar(128) null, - b_row_version rowversion not null, + b_created_by nvarchar(128) not null, -- 创建人 + b_updated_at datetime2(3) null, -- 更新时间 + b_updated_by nvarchar(128) null, -- 更新人 constraint pk_s_auth_role primary key (b_id), constraint ux_s_auth_role_key unique (b_role_key) ); create table dbo.s_auth_user_role ( - b_id bigint identity(1, 1) not null, - b_user_key nvarchar(128) not null, - b_role_key nvarchar(128) not null, - b_enabled tinyint not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_user_key nvarchar(128) not null, -- 用户稳定 key + b_role_key nvarchar(128) not null, -- 角色 key + b_enabled tinyint not null -- 是否启用(该用户角色关系) constraint df_s_auth_user_role_enabled default 1, - b_effective_from datetime2(3) null, - b_effective_to datetime2(3) null, - b_created_at datetime2(3) not null + b_effective_from datetime2(3) null, -- 生效开始时间(可定时) + b_effective_to datetime2(3) null, -- 生效结束时间(可定时) + b_created_at datetime2(3) not null -- 创建时间(UTC) constraint df_s_auth_user_role_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, + b_created_by nvarchar(128) not null, -- 创建人 constraint pk_s_auth_user_role primary key (b_id), constraint ux_s_auth_user_role_key unique (b_user_key, b_role_key) ); @@ -762,36 +515,36 @@ create index ix_s_auth_user_role_role_key ### 4.2 功能权限 +首期只做 RBAC 功能授权(页面、实体、动作、字段)。数据范围策略(`auth_data_policy`)和字段查看/导出/脱敏策略(`auth_field_policy`)作为后续扩展,不在本版本建表。 + ```sql create table dbo.s_auth_permission ( - b_id bigint identity(1, 1) not null, - b_permission_key nvarchar(192) not null, - b_module_key nvarchar(128) null, - b_resource_type nvarchar(32) not null, - b_resource_key nvarchar(256) not null, - b_action_type nvarchar(64) null, - b_name_key nvarchar(256) not null, - b_description nvarchar(1000) null, - b_enabled tinyint not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_permission_key nvarchar(192) not null, -- 权限稳定业务标识 + b_module_key nvarchar(128) null, -- 所属模块 key + b_resource_type nvarchar(32) not null, -- 资源类型(如 menu/entity/field/action) + b_resource_key nvarchar(256) not null, -- 资源稳定 key(被授权的对象) + b_action_type nvarchar(64) null, -- 操作类型(如 view/create/update/delete/confirm) + b_name_key nvarchar(256) not null, -- 权限显示名多语言 key + b_description nvarchar(1000) null, -- 权限描述 + b_enabled tinyint not null -- 是否启用 constraint df_s_auth_permission_enabled default 1, - b_protected tinyint not null - constraint df_s_auth_permission_protected default 0, - b_created_at datetime2(3) not null + b_created_at datetime2(3) not null -- 创建时间(UTC) constraint df_s_auth_permission_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, + b_created_by nvarchar(128) not null, -- 创建人 constraint pk_s_auth_permission primary key (b_id), constraint ux_s_auth_permission_key unique (b_permission_key) ); create table dbo.s_auth_role_permission ( - b_id bigint identity(1, 1) not null, - b_role_key nvarchar(128) not null, - b_permission_key nvarchar(192) not null, - b_permission_effect nvarchar(16) not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_role_key nvarchar(128) not null, -- 角色 key + b_permission_key nvarchar(192) not null, -- 权限 key + b_permission_effect nvarchar(16) not null -- 权限效果(默认 allow 允许) constraint df_s_auth_role_permission_effect default N'allow', - b_created_at datetime2(3) not null + b_created_at datetime2(3) not null -- 创建时间(UTC) constraint df_s_auth_role_permission_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, + b_created_by nvarchar(128) not null, -- 创建人 constraint pk_s_auth_role_permission primary key (b_id), constraint ux_s_auth_role_permission_key unique ( b_role_key, @@ -806,128 +559,7 @@ create index ix_s_auth_role_permission_permission_key on dbo.s_auth_role_permission (b_permission_key, b_permission_effect); ``` -### 4.3 数据范围权限 - -```sql -create table dbo.s_auth_data_policy ( - b_id bigint identity(1, 1) not null, - b_policy_key nvarchar(192) not null, - b_module_key nvarchar(128) null, - b_entity_key nvarchar(192) not null, - b_policy_name nvarchar(256) not null, - b_action_text nvarchar(max) not null, - b_scope_text nvarchar(max) not null, - b_enabled tinyint not null - constraint df_s_auth_data_policy_enabled default 1, - b_priority_no int not null - constraint df_s_auth_data_policy_priority_no default 0, - b_created_at datetime2(3) not null - constraint df_s_auth_data_policy_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - b_updated_at datetime2(3) null, - b_updated_by nvarchar(128) null, - b_row_version rowversion not null, - constraint pk_s_auth_data_policy primary key (b_id), - constraint ux_s_auth_data_policy_key unique (b_policy_key) -); - -create table dbo.s_auth_role_data_policy ( - b_id bigint identity(1, 1) not null, - b_role_key nvarchar(128) not null, - b_policy_key nvarchar(192) not null, - b_policy_effect nvarchar(16) not null - constraint df_s_auth_role_data_policy_effect default N'allow', - b_created_at datetime2(3) not null - constraint df_s_auth_role_data_policy_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - constraint pk_s_auth_role_data_policy primary key (b_id), - constraint ux_s_auth_role_data_policy_key unique ( - b_role_key, - b_policy_key - ) -); - -create index ix_s_auth_data_policy_entity_key - on dbo.s_auth_data_policy (b_entity_key, b_enabled, b_priority_no); - -create index ix_s_auth_role_data_policy_policy_key - on dbo.s_auth_role_data_policy (b_policy_key, b_policy_effect); -``` - -### 4.4 字段查看、导出和脱敏权限 - -```sql -create table dbo.s_auth_field_policy ( - b_id bigint identity(1, 1) not null, - b_policy_key nvarchar(256) not null, - b_entity_key nvarchar(192) not null, - b_field_key nvarchar(128) not null, - b_subject_type nvarchar(32) not null, - b_subject_key nvarchar(128) not null, - b_view_effect nvarchar(16) not null - constraint df_s_auth_field_policy_view_effect default N'allow', - b_export_effect nvarchar(16) not null - constraint df_s_auth_field_policy_export_effect default N'allow', - b_mask_mode nvarchar(32) not null - constraint df_s_auth_field_policy_mask_mode default N'none', - b_mask_config_text nvarchar(max) null, - b_priority_no int not null - constraint df_s_auth_field_policy_priority_no default 0, - b_enabled tinyint not null - constraint df_s_auth_field_policy_enabled default 1, - b_created_at datetime2(3) not null - constraint df_s_auth_field_policy_created_at default sysutcdatetime(), - b_created_by nvarchar(128) not null, - b_updated_at datetime2(3) null, - b_updated_by nvarchar(128) null, - b_row_version rowversion not null, - constraint pk_s_auth_field_policy primary key (b_id), - constraint ux_s_auth_field_policy_key unique (b_policy_key), - constraint ux_s_auth_field_policy_subject unique ( - b_entity_key, - b_field_key, - b_subject_type, - b_subject_key - ) -); - -create index ix_s_auth_field_policy_lookup - on dbo.s_auth_field_policy ( - b_subject_type, - b_subject_key, - b_entity_key, - b_enabled, - b_priority_no - ); - -create index ix_s_auth_field_policy_field_key - on dbo.s_auth_field_policy (b_entity_key, b_field_key, b_enabled); -``` - -### 4.5 权限快照 - -```sql -create table dbo.s_auth_permission_snapshot ( - b_id bigint identity(1, 1) not null, - b_user_key nvarchar(128) not null, - b_snapshot_version bigint not null, - b_release_id bigint not null, - b_permission_text nvarchar(max) not null, - b_checksum varchar(128) not null, - b_created_at datetime2(3) not null - constraint df_s_auth_permission_snapshot_created_at default sysutcdatetime(), - b_expires_at datetime2(3) null, - b_invalidated_at datetime2(3) null, - constraint pk_s_auth_permission_snapshot primary key (b_id), - constraint ux_s_auth_permission_snapshot_version unique ( - b_user_key, - b_snapshot_version - ) -); - -create index ix_s_auth_permission_snapshot_user_key - on dbo.s_auth_permission_snapshot (b_user_key, b_invalidated_at, b_expires_at); -``` +菜单显示继承页面访问权限:用户拥有 `s_module_menu.b_permission_key` 对应权限时菜单才显示;目录菜单在无可访问子页面时自动隐藏。前端只控制显示,后端通用数据运行时和动作引擎必须再次检查同一个权限 key。 ## 5. 日志与审计 @@ -937,28 +569,27 @@ create index ix_s_auth_permission_snapshot_user_key ```sql create table dbo.s_log_technical ( - b_id bigint identity(1, 1) not null, - b_occurred_at datetime2(3) not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_occurred_at datetime2(3) not null -- 发生时间(UTC) constraint df_s_log_technical_occurred_at default sysutcdatetime(), - b_log_level nvarchar(16) not null, - b_log_category nvarchar(64) not null, - b_operation nvarchar(192) not null, - b_org_id nvarchar(128) null, - b_user_key nvarchar(128) null, - b_source_type nvarchar(32) null, - b_module_key nvarchar(128) null, - b_entity_key nvarchar(192) null, - b_action_key nvarchar(192) null, - b_request_id nvarchar(128) null, - b_trace_id nvarchar(128) null, - b_application_version nvarchar(128) null, - b_server_node nvarchar(128) null, - b_duration_ms bigint null, - b_result_code nvarchar(128) null, - b_error_code nvarchar(128) null, - b_error_message nvarchar(2000) null, - b_exception_text nvarchar(max) null, - b_context_text nvarchar(max) null, + b_log_level nvarchar(16) not null, -- 日志级别(如 INFO/WARN/ERROR) + b_log_category nvarchar(64) not null, -- 日志分类(如 sql/exception/performance) + b_operation nvarchar(192) not null, -- 操作名(如 loadData/saveObject) + b_org_id nvarchar(128) null, -- 租户/组织 ID(日志来源标识) + b_user_key nvarchar(128) null, -- 操作用户 key + b_source_type nvarchar(32) null, -- 来源类型(如 web/api) + b_module_key nvarchar(128) null, -- 相关模块 key + b_operation_key nvarchar(192) null, -- 相关操作 key(如 saveObject.submit) + b_request_id nvarchar(128) null, -- 请求 ID + b_trace_id nvarchar(128) null, -- 追踪 ID(串联链路) + b_application_version nvarchar(128) null, -- 应用版本 + b_server_node nvarchar(128) null, -- 服务节点标识 + b_duration_ms bigint null, -- 耗时(毫秒) + b_result_code nvarchar(128) null, -- 结果码 + b_error_code nvarchar(128) null, -- 错误码 + b_error_message nvarchar(2000) null, -- 错误信息 + b_exception_text nvarchar(max) null, -- 异常堆栈(文本) + b_context_text nvarchar(max) null, -- 上下文信息(文本) constraint pk_s_log_technical primary key (b_id) ); @@ -978,22 +609,22 @@ create index ix_s_log_technical_level_time ```sql create table dbo.s_log_login ( - b_id bigint identity(1, 1) not null, - b_org_id nvarchar(128) null, - b_user_key nvarchar(128) null, - b_login_name nvarchar(256) null, - b_login_type nvarchar(32) not null, - b_login_status nvarchar(32) not null, - b_auth_method nvarchar(32) null, - b_failure_reason nvarchar(512) null, - b_ip_address varchar(64) null, - b_user_agent nvarchar(1000) null, - b_device_key nvarchar(256) null, - b_request_id nvarchar(128) null, - b_trace_id nvarchar(128) null, - b_occurred_at datetime2(3) not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_org_id nvarchar(128) null, -- 租户/组织 ID + b_user_key nvarchar(128) null, -- 用户 key + b_login_name nvarchar(256) null, -- 登录名 + b_login_type nvarchar(32) not null, -- 登录类型(如 password/token) + b_login_status nvarchar(32) not null, -- 登录状态(如 success/failed) + b_auth_method nvarchar(32) null, -- 认证方式(如 ldap/oidc) + b_failure_reason nvarchar(512) null, -- 失败原因 + b_ip_address varchar(64) null, -- 登录 IP + b_user_agent nvarchar(1000) null, -- 客户端 UA + b_device_key nvarchar(256) null, -- 设备标识 + b_request_id nvarchar(128) null, -- 请求 ID + b_trace_id nvarchar(128) null, -- 追踪 ID + b_occurred_at datetime2(3) not null -- 发生时间(UTC) constraint df_s_log_login_occurred_at default sysutcdatetime(), - b_created_at datetime2(3) not null + b_created_at datetime2(3) not null -- 创建时间(UTC) constraint df_s_log_login_created_at default sysutcdatetime(), constraint pk_s_log_login primary key (b_id) ); @@ -1015,44 +646,42 @@ create index ix_s_log_login_trace_id ```sql create table dbo.s_log_audit ( - b_id bigint identity(1, 1) not null, - b_event_key nvarchar(192) not null, - b_module_key nvarchar(128) null, - b_entity_key nvarchar(192) not null, - b_entity_id nvarchar(128) not null, - b_business_no nvarchar(192) null, - b_action_key nvarchar(192) null, - b_operator_key nvarchar(128) not null, - b_operator_name nvarchar(256) null, - b_source_type nvarchar(32) not null, - b_visibility nvarchar(32) not null, - b_request_id nvarchar(128) null, - b_trace_id nvarchar(128) not null, - b_release_id bigint null, - b_business_event_id bigint null, - b_payload_text nvarchar(max) null, - b_occurred_at datetime2(3) not null + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_event_key nvarchar(192) not null, -- 业务事件稳定标识 + b_module_key nvarchar(128) not null, -- 被审计的数据模块 key + b_entity_id nvarchar(128) not null, -- 被审计的业务数据 ID + b_business_no nvarchar(192) null, -- 业务单号(如订舱号) + b_operation_key nvarchar(192) null, -- 触发的操作 key(如 saveObject.submit) + b_operator_key nvarchar(128) not null, -- 操作人 key + b_operator_name nvarchar(256) null, -- 操作人名称(快照) + b_source_type nvarchar(32) not null, -- 来源类型(如 user/ai/api) + b_visibility nvarchar(32) not null, -- 可见性(内部/客户可见) + b_request_id nvarchar(128) null, -- 请求 ID + b_trace_id nvarchar(128) not null, -- 追踪 ID(关联技术日志) + b_business_event_id bigint null, -- 关联的业务事件 ID + b_payload_text nvarchar(max) null, -- 事件载荷(文本,如前后快照) + b_occurred_at datetime2(3) not null -- 发生时间(UTC) constraint df_s_log_audit_occurred_at default sysutcdatetime(), constraint pk_s_log_audit primary key (b_id) ); create table dbo.s_log_audit_field ( - b_id bigint identity(1, 1) not null, - b_event_id bigint not null, - b_entity_key nvarchar(192) not null, - b_entity_id nvarchar(128) not null, - b_field_key nvarchar(128) not null, - b_field_label_snapshot nvarchar(256) null, - b_before_value_text nvarchar(max) null, - b_after_value_text nvarchar(max) null, - b_before_display_value nvarchar(1000) null, - b_after_display_value nvarchar(1000) null, - b_visibility nvarchar(32) not null, + b_id bigint identity(1, 1) not null, -- 内部自增主键 + b_event_id bigint not null, -- 所属审计事件 ID + b_module_key nvarchar(128) not null, -- 数据模块 key + b_entity_id nvarchar(128) not null, -- 业务数据 ID + b_field_key nvarchar(128) not null, -- 变更的字段 key + b_field_label_snapshot nvarchar(256) null, -- 字段标签快照 + b_before_value_text nvarchar(max) null, -- 变更前原始值 + b_after_value_text nvarchar(max) null, -- 变更后原始值 + b_before_display_value nvarchar(1000) null, -- 变更前显示值(如引用字段 label) + b_after_display_value nvarchar(1000) null, -- 变更后显示值 + b_visibility nvarchar(32) not null, -- 可见性(内部/客户可见) constraint pk_s_log_audit_field primary key (b_id) ); -create index ix_s_log_audit_entity - on dbo.s_log_audit (b_entity_key, b_entity_id, b_occurred_at desc); +create index ix_s_log_audit_module + on dbo.s_log_audit (b_module_key, b_entity_id, b_occurred_at desc); create index ix_s_log_audit_trace_id on dbo.s_log_audit (b_trace_id); @@ -1063,41 +692,34 @@ create index ix_s_log_audit_field_audit_event_id ## 6. 逻辑外键清单 -以下关联不创建物理外键,由服务层、发布校验器和 Schema Compiler 负责检查: +以下关联不创建物理外键,由服务层、变更校验器和 Schema Compiler 负责检查: | 表 | 字段 | 逻辑目标 | | --- | --- | --- | -| `s_meta_entity` | `b_module_key` | `s_meta_module.b_module_key` | -| `s_meta_field` | `b_entity_key` | `s_meta_entity.b_entity_key` | -| `s_meta_relation` | `b_source_entity_key` | `s_meta_entity.b_entity_key` | -| `s_meta_relation` | `b_target_entity_key` | `s_meta_entity.b_entity_key` | -| `s_meta_dictionary_item` | `b_dictionary_id` | `s_meta_dictionary.b_id` | -| `s_meta_page` | `b_module_key` | `s_meta_module.b_module_key` | -| `s_meta_page` | `b_view_key` | `s_meta_view.b_view_key` | -| `s_meta_page` | `b_form_key` | `s_meta_form.b_form_key` | -| `s_meta_page` | `b_permission_key` | `s_auth_permission.b_permission_key` | -| `s_meta_menu` | `b_module_key` | `s_meta_module.b_module_key` | -| `s_meta_menu` | `b_parent_menu_key` | `s_meta_menu.b_menu_key` | -| `s_meta_menu` | `b_page_key` | `s_meta_page.b_page_key` | -| `s_meta_menu` | `b_permission_key` | `s_auth_permission.b_permission_key` | -| `s_meta_view` | `b_entity_key` | `s_meta_entity.b_entity_key` | -| `s_meta_view_field` | `b_view_id` | `s_meta_view.b_id` | -| `s_meta_form` | `b_entity_key` | `s_meta_entity.b_entity_key` | -| `s_meta_form_field` | `b_form_id` | `s_meta_form.b_id` | -| `s_meta_form_relation` | `b_form_id` | `s_meta_form.b_id` | -| `s_meta_form_relation` | `b_relation_key` | `s_meta_relation.b_relation_key` | -| `s_meta_form_relation` | `b_child_view_key` | `s_meta_view.b_view_key` | -| `s_meta_form_relation` | `b_child_form_key` | `s_meta_form.b_form_key` | -| `s_meta_release` | `b_change_set_id` | `s_meta_change_set.b_id` | -| `s_meta_release_resource` | `b_release_id` | `s_meta_release.b_id` | -| `s_meta_runtime_state` | `b_current_release_id` | `s_meta_release.b_id` | -| `s_schema_migration` | `b_change_set_id` | `s_meta_change_set.b_id` | -| `s_schema_migration_step` | `b_migration_id` | `s_schema_migration.b_id` | +| `s_module_dependency` | `b_module_key` | `s_module.b_module_key` | +| `s_module_dependency` | `b_depends_on_module_key` | `s_module.b_module_key` | +| `s_module_entity` | `b_module_key` | `s_module.b_module_key` | +| `s_module_field` | `b_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_relation` | `b_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_relation` | `b_target_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_menu` | `b_module_key` | `s_module.b_module_key` | +| `s_module_menu` | `b_parent_menu_key` | `s_module_menu.b_menu_key` | +| `s_module_menu` | `b_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_menu` | `b_view_key` | `s_module_view.b_view_key` | +| `s_module_menu` | `b_form_key` | `s_module_form.b_form_key` | +| `s_module_menu` | `b_permission_key` | `s_auth_permission.b_permission_key` | +| `s_module_view` | `b_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_view_field` | `b_view_key` | `s_module_view.b_view_key` | +| `s_module_view_field` | `b_field_key` | 实体范围内的 `s_module_field.b_field_key` | +| `s_module_form` | `b_entity_key` | `s_module_entity.b_entity_key` | +| `s_module_form_field` | `b_form_key` | `s_module_form.b_form_key` | +| `s_module_form_field` | `b_field_key` | 实体范围内的 `s_module_field.b_field_key` | +| `s_module_form_relation` | `b_form_key` | `s_module_form.b_form_key` | +| `s_module_form_relation` | `b_relation_key` | `s_module_relation.b_relation_key` | +| `s_module_form_relation` | `b_child_view_key` | `s_module_view.b_view_key` | +| `s_module_form_relation` | `b_child_form_key` | `s_module_form.b_form_key` | | `s_auth_user_role` | `b_role_key` | `s_auth_role.b_role_key` | | `s_auth_role_permission` | `b_permission_key` | `s_auth_permission.b_permission_key` | -| `s_auth_role_data_policy` | `b_policy_key` | `s_auth_data_policy.b_policy_key` | -| `s_auth_field_policy` | `b_entity_key` | `s_meta_entity.b_entity_key` | -| `s_auth_field_policy` | `b_field_key` | `s_meta_field.b_field_key` | | `s_log_audit_field` | `b_event_id` | `s_log_audit.b_id` | | `s_log_technical` | `b_user_key` | 当前身份系统的用户 `b_user_key` | | `s_log_login` | `b_user_key` | 当前身份系统的用户 `b_user_key` | @@ -1106,10 +728,9 @@ create index ix_s_log_audit_field_audit_event_id ```text 稳定 key 是否存在 --> 目标资源是否属于当前 release -> 目标资源是否启用 --> 模块依赖是否合法 --> 字段、关系和页面类型是否匹配 +-> 跨模块引用是否合法(依赖图中可达) +-> 字段、实体类型和视图/表单配置是否匹配 -> 删除或停用前是否仍被其他资源引用 ``` @@ -1118,11 +739,10 @@ create index ix_s_log_audit_field_audit_event_id 建议按以下顺序创建和启用这些表: ```text -元数据基础表 --> 页面和菜单表 --> 视图和动态表单表 --> 配置 release 表 --> Schema 迁移表 +元数据基础表(模块/依赖/实体/字段/关系) +-> 视图与表单表 +-> 页面菜单入口表 +-> 多语言表 -> 权限表 -> 日志与审计表 ``` @@ -1133,5 +753,5 @@ create index ix_s_log_audit_field_audit_event_id - 根据现有用户表确定 `b_user_key`、`b_created_by` 和 `b_updated_by` 的实际数据类型。 - 根据最终稳定 key 长度评估唯一索引的键长度。 - 为高数据量审计表制定归档及清理策略。 -- 用独立测试数据库执行完整建表脚本,并验证重复安装、初始化 release 和回滚流程。 - +- 用独立测试数据库执行完整建表脚本,并验证重复安装和 Schema 迁移流程。 +- 选择一条真实业务纵向验证(例如"基础资料 + 海运订舱 + 确认动作"),验证售后新增字段、Schema Compiler 加列、生成列表/表单和 DDL 失败回滚的完整链路。 diff --git a/code/fms/Fms旧系统表结构.md b/code/fms/Fms旧系统表结构.md new file mode 100644 index 00000000..d1181272 --- /dev/null +++ b/code/fms/Fms旧系统表结构.md @@ -0,0 +1,2187 @@ +# Fms 旧系统表结构(G3HD / FMS 库) + +> 来源库:`FMS`(jdbc:sqlserver://118.89.70.199:1433;databaseName=FMS) +> 仅包含用户表(BASE TABLE),不含视图。字段「备注」列留空,供后续补充含义。 + +共 **100** 张表。 + +## 表清单(索引) + +| # | 表名 | 字段数 | 主键 | +| --- | --- | --- | --- | +| 1 | `b_bgtype` | 3 | b_id | +| 2 | `b_billtype` | 3 | b_id | +| 3 | `b_blstate` | 7 | b_id | +| 4 | `b_city` | 12 | b_id | +| 5 | `b_con_type` | 12 | b_id | +| 6 | `b_contact` | 33 | b_id | +| 7 | `b_cztype` | 8 | b_id | +| 8 | `b_dailyfeetype` | 8 | b_id | +| 9 | `b_dailytype` | 4 | b_id | +| 10 | `b_feetype` | 13 | b_id | +| 11 | `b_freightpayment` | 8 | b_id | +| 12 | `b_from` | 4 | b_id | +| 13 | `b_goodssource` | 8 | b_id | +| 14 | `b_grade` | 4 | b_id | +| 15 | `b_hl` | 12 | b_id | +| 16 | `b_httype` | 8 | b_id | +| 17 | `b_i18n` | 5 | b_id | +| 18 | `b_i18n_type` | 6 | b_id | +| 19 | `b_ivtype` | 8 | b_id | +| 20 | `b_jsfs` | 7 | b_id | +| 21 | `b_money` | 14 | b_id | +| 22 | `b_oceanline` | 10 | b_id | +| 23 | `b_operator` | 4 | b_id | +| 24 | `b_othercompany` | 50 | b_id | +| 25 | `b_othercompany_accountbank` | 9 | subid | +| 26 | `b_othercompany_bmfl` | 11 | b_id | +| 27 | `b_othercompany_partner_type` | 8 | b_id | +| 28 | `b_package` | 9 | b_id | +| 29 | `b_port` | 14 | b_id | +| 30 | `b_progress` | 8 | b_id | +| 31 | `b_sys_bgstate` | 3 | b_id | +| 32 | `b_sys_companytype` | 7 | b_id | +| 33 | `b_sys_copies` | 8 | b_id | +| 34 | `b_sys_cystate` | 3 | b_id | +| 35 | `b_sys_edittype` | 4 | b_id | +| 36 | `b_sys_feesf` | 4 | b_id | +| 37 | `b_sys_fielddefault` | 4 | b_id | +| 38 | `b_sys_level` | 4 | b_id | +| 39 | `b_sys_operator` | 8 | b_id | +| 40 | `b_sys_pricelisttype` | 5 | b_id | +| 41 | `b_sys_sex` | 8 | b_id | +| 42 | `b_sys_state` | 8 | b_id | +| 43 | `b_sys_yesno` | 4 | b_id | +| 44 | `b_transway` | 9 | b_id | +| 45 | `b_user` | 23 | b_id | +| 46 | `b_user_feetype` | 8 | b_id | +| 47 | `b_user_module` | 5 | b_id | +| 48 | `b_user_power` | 6 | b_id | +| 49 | `b_user_worktime` | 10 | b_id | +| 50 | `b_vessel` | 10 | b_id | +| 51 | `b_ysfs` | 7 | b_id | +| 52 | `b_ystype` | 4 | b_id | +| 53 | `b_ywtype` | 7 | b_id | +| 54 | `b_zxstate` | 8 | b_id | +| 55 | `bc_khht` | 17 | b_id | +| 56 | `bc_pricelist` | 17 | b_id | +| 57 | `bc_pricelist_bmfl` | 11 | b_id | +| 58 | `bc_pricelist_sub` | 28 | subid | +| 59 | `bc_priceList_type` | 4 | b_id | +| 60 | `bf_files` | 20 | subid | +| 61 | `bf_files_cateid` | 11 | b_id | +| 62 | `bf_files_type` | 12 | b_id | +| 63 | `bs_business` | 93 | b_id | +| 64 | `bs_business_container` | 45 | subid | +| 65 | `bs_business_cw` | 66 | subid | +| 66 | `bs_business_hdbl` | 29 | subid | +| 67 | `bs_business_hdbl_sub` | 19 | subid | +| 68 | `bs_business_transport` | 46 | subid | +| 69 | `cw_account` | 17 | b_id | +| 70 | `cw_account_type` | 8 | b_id | +| 71 | `cw_bill` | 29 | b_id | +| 72 | `cw_bill_business` | 4 | subid | +| 73 | `cw_billsub` | 8 | subid | +| 74 | `cw_daily` | 21 | b_id | +| 75 | `cw_invoice` | 28 | b_id | +| 76 | `cw_invoice_bill` | 4 | subid | +| 77 | `cw_invoice_business` | 4 | subid | +| 78 | `cw_invoicesub` | 8 | subid | +| 79 | `cw_sfd` | 30 | b_id | +| 80 | `cw_sfd_bill` | 4 | subid | +| 81 | `cw_sfd_business` | 4 | subid | +| 82 | `cw_sfd_invoice` | 4 | subid | +| 83 | `cw_sfdsub` | 10 | subid | +| 84 | `oa_notices` | 17 | b_id | +| 85 | `oa_notices_attach` | 11 | SubID | +| 86 | `oa_notices_dl` | 9 | b_id | +| 87 | `oa_notices_xl` | 10 | b_id | +| 88 | `oa_noticesSub` | 8 | subid | +| 89 | `oa_reminder` | 13 | b_id | +| 90 | `oa_title` | 12 | b_id | +| 91 | `oa_title_bmfl` | 11 | b_id | +| 92 | `s_login_log` | 16 | b_id | +| 93 | `s_module` | 15 | b_id | +| 94 | `s_module_auto_code` | 12 | b_id | +| 95 | `s_module_field` | 9 | b_id | +| 96 | `s_module_field_edit` | 9 | b_id | +| 97 | `s_module_field_group` | 7 | b_id | +| 98 | `s_module_field_list` | 8 | b_id | +| 99 | `s_module_field_query` | 8 | b_id | +| 100 | `s_module_power` | 7 | b_id | + +## 各表字段结构 + +### b_bgtype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_billtype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_blstate + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_city + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name_c` | nvarchar | 50 | | YES | | | +| `b_name_e` | nvarchar | 50 | | YES | | | +| `b_country_name_e` | nvarchar | 50 | | YES | | | +| `b_country_name_c` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_xh` | int | | 10,0 | YES | | | + +### b_con_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_type` | varchar | 50 | | YES | | | +| `b_linkcon` | varchar | 50 | | YES | | | +| `b_default` | int | | 10,0 | NO | ((0)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_contact + +**主键:** b_id + +**外键:** +- b_customer_id -> b_othercompany(b_id) +- b_owner_id -> b_user(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name_ch` | nvarchar | 50 | | YES | | | +| `b_name_en` | nvarchar | 50 | | YES | | | +| `b_sex` | nvarchar | 50 | | YES | | | +| `b_phone` | nvarchar | 50 | | YES | | | +| `b_mobilephone` | nvarchar | 50 | | YES | | | +| `b_fax` | nvarchar | 50 | | YES | | | +| `b_email` | varchar | 200 | | YES | | | +| `b_cate_id` | bigint | | 19,0 | YES | | | +| `b_duty` | nvarchar | 50 | | YES | | | +| `b_homephone` | nvarchar | 50 | | YES | | | +| `b_homeaddr` | nvarchar | 255 | | YES | | | +| `b_bz` | nvarchar | MAX | | YES | | | +| `b_departmentname` | nvarchar | 100 | | YES | | | +| `b_picture` | varbinary | MAX | | YES | | | +| `b_customer_id` | bigint | | 19,0 | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_isdefault` | int | | 10,0 | NO | ((0)) | | +| `b_showcolor` | int | | 10,0 | YES | | | +| `b_birthday` | date | | | YES | | | +| `b_type1_id` | bigint | | 19,0 | YES | | | +| `b_taste` | nvarchar | 100 | | YES | | | +| `b_habit` | nvarchar | 100 | | YES | | | +| `b_homesituation` | nvarchar | 100 | | YES | | | +| `b_htbegindate` | date | | | YES | | | +| `b_htenddate` | date | | | YES | | | +| `b_state` | nvarchar | 50 | | YES | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | NO | (sysdatetime()) | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### b_cztype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_dailyfeetype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_dailytype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_feetype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_name_e` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_default` | int | | 10,0 | NO | ((0)) | | +| `b_amount` | decimal | | 18,2 | YES | | | +| `b_tax` | decimal | | 18,4 | YES | | | +| `b_money_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_freightpayment + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_from + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_goodssource + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_grade + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_hl + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_money_id` | bigint | | 19,0 | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_type` | varchar | 50 | | YES | | | +| `b_hl` | decimal | | 18,4 | YES | | | +| `b_month` | varchar | 50 | | YES | | | +| `b_qsdate` | datetime2 | | | YES | | | +| `b_zzdate` | datetime2 | | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### b_httype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_i18n + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_key` | varchar | 150 | | NO | | | +| `b_locale` | varchar | 20 | | NO | | | +| `b_value` | nvarchar | 500 | | NO | | | +| `b_module_id` | bigint | | 19,0 | YES | | | + +### b_i18n_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_code` | varchar | 20 | | NO | | | +| `b_name` | nvarchar | 100 | | NO | | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_default` | int | | 10,0 | NO | ((0)) | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### b_ivtype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_jsfs + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_money + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_hl` | decimal | | 18,4 | YES | | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_xh` | int | | 10,0 | YES | | | +| `b_symbol` | nvarchar | 50 | | YES | | | +| `b_isconvert` | varchar | 1 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_oceanline + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_xh` | int | | 10,0 | YES | | | + +### b_operator + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_othercompany + +**主键:** b_id + +**外键:** +- b_cate_id -> b_othercompany_bmfl(b_id) +- b_owner_id -> b_user(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_pycode` | varchar | 50 | | YES | | | +| `b_type` | nvarchar | 200 | | YES | | | +| `b_name` | nvarchar | 500 | | NO | | | +| `b_shortname` | nvarchar | 100 | | YES | | | +| `b_linkman` | nvarchar | 200 | | YES | | | +| `b_phone` | nvarchar | 500 | | YES | | | +| `b_addr` | nvarchar | 500 | | YES | | | +| `b_firstlinkdate` | date | | | YES | | | +| `b_htno` | varchar | 50 | | YES | | | +| `b_htdate` | date | | | YES | | | +| `b_htexpiredate` | date | | | YES | | | +| `b_black` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_zl` | int | | 10,0 | NO | ((0)) | | +| `b_tel` | nvarchar | 50 | | YES | | | +| `b_fax` | nvarchar | 500 | | YES | | | +| `b_www` | varchar | 200 | | YES | | | +| `b_email` | varchar | 200 | | YES | | | +| `b_bankacount` | nvarchar | 500 | | YES | | | +| `b_invaccount` | nvarchar | 500 | | YES | | | +| `b_cate_id` | bigint | | 19,0 | YES | | | +| `b_bz1` | nvarchar | 500 | | YES | | | +| `b_bz2` | nvarchar | 500 | | YES | | | +| `b_bz3` | nvarchar | 500 | | YES | | | +| `b_bz4` | nvarchar | 500 | | YES | | | +| `b_province` | nvarchar | 50 | | YES | | | +| `b_city` | nvarchar | 50 | | YES | | | +| `b_area` | nvarchar | 50 | | YES | | | +| `b_country` | nvarchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_showcolor` | int | | 10,0 | YES | | | +| `b_type_id` | bigint | | 19,0 | YES | | | +| `b_from_id` | bigint | | 19,0 | YES | | | +| `b_type1_id` | bigint | | 19,0 | YES | | | +| `b_type2_id` | bigint | | 19,0 | YES | | | +| `b_type3_id` | bigint | | 19,0 | YES | | | +| `b_type4_id` | bigint | | 19,0 | YES | | | +| `b_type5_id` | bigint | | 19,0 | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | NO | (sysdatetime()) | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_password` | varchar | 200 | | YES | | | +| `b_state` | nvarchar | 50 | | YES | | | +| `b_bankacount_e` | nvarchar | 500 | | YES | | | +| `b_addr_e` | nvarchar | 500 | | YES | | | +| `b_name_e` | nvarchar | 500 | | YES | | | + +### b_othercompany_accountbank + +**主键:** subid + +**外键:** +- father -> b_othercompany(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_bank` | nvarchar | 800 | | YES | | | +| `mx_bz1` | nvarchar | 200 | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | + +### b_othercompany_bmfl + +**主键:** b_id + +**外键:** +- b_parent_id -> b_othercompany_bmfl(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_parent_id` | bigint | | 19,0 | YES | | | +| `b_name` | nvarchar | 150 | | NO | | | +| `b_level` | int | | 10,0 | NO | ((1)) | | +| `b_path` | varchar | 1000 | | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime | | | YES | | | + +### b_othercompany_partner_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_package + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 100 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_port + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name_c` | nvarchar | 50 | | YES | | | +| `b_name_e` | nvarchar | 50 | | YES | | | +| `b_country` | varchar | 50 | | YES | | | +| `b_oceanline` | varchar | 50 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_tz` | varchar | 1 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_xh` | int | | 10,0 | YES | | | + +### b_progress + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_bgstate + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_companytype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_copies + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_cystate + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_edittype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_feesf + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_fielddefault + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_level + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_operator + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_pricelisttype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_dw_name` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_sex + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_state + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_sys_yesno + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_transway + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 100 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 100 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_user + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_account` | nvarchar | 50 | | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_department` | nvarchar | 50 | | YES | | | +| `b_subcode` | nvarchar | 50 | | YES | | | +| `b_machineid` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_password` | nvarchar | 255 | | NO | | | +| `b_canuse` | tinyint | | 3,0 | NO | ((1)) | | +| `b_othermachinelogin` | tinyint | | 3,0 | NO | ((0)) | | +| `b_salesman` | tinyint | | 3,0 | NO | ((0)) | | +| `b_docman` | tinyint | | 3,0 | NO | ((0)) | | +| `b_dealman` | tinyint | | 3,0 | NO | ((0)) | | +| `b_receivelevel` | tinyint | | 3,0 | YES | | | +| `b_paylevel` | tinyint | | 3,0 | YES | | | +| `b_visible_customer` | tinyint | | 3,0 | NO | ((0)) | | +| `b_visible_supply` | tinyint | | 3,0 | NO | ((0)) | | +| `b_levelvisible` | tinyint | | 3,0 | NO | ((0)) | | +| `b_fromcustomer` | tinyint | | 3,0 | NO | ((0)) | | +| `b_logintime` | tinyint | | 3,0 | NO | ((0)) | | +| `b_checkxy` | tinyint | | 3,0 | NO | ((0)) | | +| `b_loginfee` | tinyint | | 3,0 | NO | ((0)) | | +| `b_phone` | nvarchar | 50 | | YES | | | + +### b_user_feetype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_user_id` | bigint | | 19,0 | YES | | | +| `b_feetype_id` | bigint | | 19,0 | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### b_user_module + +**主键:** b_id + +**外键:** +- b_user_id -> b_user(b_id) +- b_module_id -> s_module(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_user_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_inputuser_id` | bigint | | 19,0 | NO | | | +| `b_inputdatetime` | datetime | | | NO | (getdate()) | | + +### b_user_power + +**主键:** b_id + +**外键:** +- b_user_id -> b_user(b_id) +- b_module_id -> s_module(b_id) +- b_power_id -> s_module_power(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_user_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_power_id` | bigint | | 19,0 | NO | | | +| `b_inputuser_id` | bigint | | 19,0 | NO | | | +| `b_inputdatetime` | datetime | | | NO | (getdate()) | | + +### b_user_worktime + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_user_id` | bigint | | 19,0 | YES | | | +| `b_day` | varchar | 10 | | YES | | | +| `b_timefrom` | varchar | 20 | | YES | | | +| `b_timeto` | varchar | 20 | | YES | | | +| `b_used` | int | | 10,0 | NO | ((1)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### b_vessel + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_vessel_name` | nvarchar | 100 | | YES | | | +| `b_edicode` | varchar | 50 | | YES | | | +| `b_voy` | varchar | 100 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_ysfs + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_ystype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_ywtype + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### b_zxstate + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 200 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### bc_khht + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_customer_id` | bigint | | 19,0 | YES | | | +| `b_htno` | varchar | 50 | | NO | | | +| `b_begindate` | date | | | YES | | | +| `b_enddate` | date | | | YES | | | +| `b_httype` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_zl` | decimal | | 18,0 | YES | | | +| `b_bz1` | nvarchar | 50 | | YES | | | +| `b_sales_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | + +### bc_pricelist + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_type` | varchar | 50 | | YES | | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_begindate` | date | | | YES | | | +| `b_enddate` | date | | | YES | | | +| `b_loadport` | varchar | 50 | | YES | | | +| `b_aimport` | varchar | 50 | | YES | | | +| `b_cate_id` | bigint | | 19,0 | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### bc_pricelist_bmfl + +**主键:** b_id + +**外键:** +- b_parent_id -> bc_pricelist_bmfl(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_parent_id` | bigint | | 19,0 | YES | | | +| `b_name` | nvarchar | 150 | | NO | | | +| `b_level` | int | | 10,0 | NO | ((1)) | | +| `b_path` | varchar | 1000 | | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | NO | (sysdatetime()) | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### bc_pricelist_sub + +**主键:** subid + +**外键:** +- father -> bc_pricelist(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_dw_id` | bigint | | 19,0 | YES | | | +| `mx_dw_field` | varchar | 50 | | YES | | | +| `mx_type_id` | bigint | | 19,0 | YES | | | +| `mx_feetype_id` | bigint | | 19,0 | YES | | | +| `mx_moneytype_id` | bigint | | 19,0 | YES | | | +| `mx_exrate` | decimal | | 18,4 | YES | | | +| `mx_price` | decimal | | 18,2 | YES | | | +| `mx_qty` | decimal | | 18,3 | YES | | | +| `mx_amount_root` | decimal | | 18,3 | YES | | | +| `mx_amount` | decimal | | 18,3 | YES | | | +| `mx_tax` | decimal | | 18,4 | YES | | | +| `mx_level` | int | | 10,0 | YES | | | +| `mx_hstype_id` | bigint | | 19,0 | YES | | | +| `mx_varchar_1` | varchar | 50 | | YES | | | +| `mx_varchar_2` | varchar | 50 | | YES | | | +| `mx_varchar_3` | varchar | 50 | | YES | | | +| `mx_varchar_4` | varchar | 50 | | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### bc_priceList_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### bf_files + +**主键:** subid + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_filename` | nvarchar | 500 | | YES | | | +| `mx_filesize` | varchar | 50 | | YES | | | +| `mx_fileext` | varchar | 50 | | YES | | | +| `mx_mapfilename` | nvarchar | 500 | | YES | | | +| `mx_moduleid` | bigint | | 19,0 | YES | | | +| `mx_cutfilename` | nvarchar | 500 | | YES | | | +| `mx_cutfilesize` | varchar | 50 | | YES | | | +| `mx_cate_id` | bigint | | 19,0 | YES | | | +| `mx_bz` | nvarchar | 500 | | YES | | | +| `mx_orderid` | varchar | 50 | | YES | | | +| `mx_sh` | int | | 10,0 | NO | ((0)) | | +| `mx_shdatetime` | datetime2 | | | YES | | | +| `mx_shuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | + +### bf_files_cateid + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_xh` | int | | 10,0 | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_files_type` | varchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### bf_files_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_module_id` | bigint | | 19,0 | YES | | | +| `b_module_name` | nvarchar | 50 | | YES | | | +| `b_xh` | int | | 10,0 | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_image_num` | decimal | | 18,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### bs_business + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_ywno` | varchar | 50 | | NO | | | +| `b_drno` | varchar | 50 | | YES | | | +| `b_ywtype` | varchar | 50 | | YES | | | +| `b_cargo_source` | varchar | 50 | | YES | | | +| `b_orderdate` | datetime2 | | | YES | | | +| `b_transterm` | varchar | 50 | | YES | | | +| `b_customer_id` | bigint | | 19,0 | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_loadport` | varchar | 50 | | YES | | | +| `b_disport` | varchar | 50 | | YES | | | +| `b_aimport` | varchar | 50 | | YES | | | +| `b_transport` | varchar | 50 | | YES | | | +| `b_freightpayment` | varchar | 50 | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_ysfs` | varchar | 50 | | YES | | | +| `b_ac_ctns` | int | | 10,0 | YES | | | +| `b_ac_vol` | decimal | | 18,3 | YES | | | +| `b_ac_gw` | decimal | | 18,3 | YES | | | +| `b_ctns` | int | | 10,0 | YES | | | +| `b_ctns_unit` | varchar | 50 | | YES | | | +| `b_namegoods` | nvarchar | 4000 | | YES | | | +| `b_vol` | decimal | | 18,3 | YES | | | +| `b_gw` | decimal | | 18,3 | YES | | | +| `b_voy` | varchar | 50 | | YES | | | +| `b_vessel` | varchar | 50 | | YES | | | +| `b_etd` | datetime2 | | | YES | | | +| `b_eta` | datetime2 | | | YES | | | +| `b_shipingdate` | datetime2 | | | YES | | | +| `b_arrivedate` | datetime2 | | | YES | | | +| `b_jgdate` | datetime2 | | | YES | | | +| `b_jddate` | datetime2 | | | YES | | | +| `b_progress` | varchar | 50 | | YES | | | +| `b_desc_con` | nvarchar | 100 | | YES | | | +| `b_desc_noandseal` | nvarchar | 150 | | YES | | | +| `b_sales_id` | bigint | | 19,0 | YES | | | +| `b_doc_id` | bigint | | 19,0 | YES | | | +| `b_sw_id` | bigint | | 19,0 | YES | | | +| `b_operater_id` | bigint | | 19,0 | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_shipcompany_id` | bigint | | 19,0 | YES | | | +| `b_warehouse_id` | bigint | | 19,0 | YES | | | +| `b_oceanline` | varchar | 50 | | YES | | | +| `b_bgcompany_id` | bigint | | 19,0 | YES | | | +| `b_truck_id` | bigint | | 19,0 | YES | | | +| `b_loaddate` | datetime2 | | | YES | | | +| `b_dcdw_id` | bigint | | 19,0 | YES | | | +| `b_dcdwlinkman` | varchar | 50 | | YES | | | +| `b_dcno` | varchar | 50 | | YES | | | +| `b_dcdate` | datetime2 | | | YES | | | +| `b_fcdate` | datetime2 | | | YES | | | +| `b_jgbegindate` | date | | | YES | | | +| `b_jgenddate` | date | | | YES | | | +| `b_pcyqmemo` | nvarchar | 1000 | | YES | | | +| `b_enterstoreno` | varchar | 50 | | YES | | | +| `b_showcolor` | varchar | 50 | | YES | | | +| `b_blno` | varchar | 50 | | YES | | | +| `b_bl_copy` | varchar | 50 | | YES | | | +| `b_bl_state` | varchar | 50 | | YES | | | +| `b_bl_date` | datetime2 | | | YES | | | +| `b_bl_qsdate` | datetime2 | | | YES | | | +| `b_bl_jcdate` | datetime2 | | | YES | | | +| `b_bgdate` | datetime2 | | | YES | | | +| `b_bgno` | varchar | 50 | | YES | | | +| `b_bgtype` | varchar | 50 | | YES | | | +| `b_bgstate` | varchar | 50 | | YES | | | +| `b_cystate` | varchar | 50 | | YES | | | +| `b_bz1` | nvarchar | 1000 | | YES | | | +| `b_bz2` | nvarchar | 1000 | | YES | | | +| `b_bz3` | nvarchar | 1000 | | YES | | | +| `b_bz4` | nvarchar | 1000 | | YES | | | +| `b_shippermemo` | nvarchar | 2000 | | YES | | | +| `b_consigneememo` | nvarchar | 2000 | | YES | | | +| `b_notifymemo` | nvarchar | 2000 | | YES | | | +| `b_shipmark` | nvarchar | 2000 | | YES | | | +| `b_agentcompanyMemo` | nvarchar | 2000 | | YES | | | +| `b_con20` | int | | 10,0 | YES | | | +| `b_con40` | int | | 10,0 | YES | | | +| `b_con40h` | int | | 10,0 | YES | | | +| `b_con45` | int | | 10,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_yslocked` | varchar | 1 | | YES | | | +| `b_yslocked_date` | datetime2 | | | YES | | | +| `b_yslocked_userid` | bigint | | 19,0 | YES | | | +| `b_yflocked` | varchar | 1 | | YES | | | +| `b_yflocked_date` | datetime2 | | | YES | | | +| `b_yflocked_userid` | bigint | | 19,0 | YES | | | +| `b_cwlocked` | varchar | 1 | | YES | | | +| `b_cwlocked_date` | datetime2 | | | YES | | | +| `b_cwlocked_userid` | bigint | | 19,0 | YES | | | + +### bs_business_container + +**主键:** subid + +**外键:** +- father -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_hstype_id` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_con_no` | varchar | 50 | | YES | | | +| `mx_sealno` | varchar | 50 | | YES | | | +| `mx_con_type` | varchar | 50 | | YES | | | +| `mx_con_size` | varchar | 50 | | YES | | | +| `mx_con_gw` | decimal | | 18,6 | YES | | | +| `mx_con_nw` | decimal | | 18,6 | YES | | | +| `mx_con_cartons` | int | | 10,0 | YES | | | +| `mx_con_vol` | decimal | | 18,6 | YES | | | +| `mx_truck_id` | bigint | | 19,0 | YES | | | +| `mx_truck_name` | nvarchar | 50 | | YES | | | +| `mx_truckno` | varchar | 50 | | YES | | | +| `mx_drive` | varchar | 50 | | YES | | | +| `mx_drivephone` | varchar | 50 | | YES | | | +| `mx_txplace` | nvarchar | 50 | | YES | | | +| `mx_txmemo` | nvarchar | 500 | | YES | | | +| `mx_txdate` | datetime2 | | | YES | | | +| `mx_zxdate` | datetime2 | | | YES | | | +| `mx_zxplace` | nvarchar | 50 | | YES | | | +| `mx_zxmemo` | nvarchar | 500 | | YES | | | +| `mx_date1` | datetime2 | | | YES | | | +| `mx_date2` | datetime2 | | | YES | | | +| `mx_date3` | datetime2 | | | YES | | | +| `mx_date4` | datetime2 | | | YES | | | +| `mx_date5` | datetime2 | | | YES | | | +| `mx_date6` | datetime2 | | | YES | | | +| `mx_bz1` | nvarchar | 500 | | YES | | | +| `mx_bz2` | nvarchar | 100 | | YES | | | +| `mx_bz3` | nvarchar | 100 | | YES | | | +| `mx_bz4` | nvarchar | 100 | | YES | | | +| `mx_bz5` | nvarchar | 100 | | YES | | | +| `mx_bz6` | nvarchar | 100 | | YES | | | +| `mx_bz7` | nvarchar | 100 | | YES | | | +| `mx_bz8` | nvarchar | 100 | | YES | | | +| `mx_memo8` | nvarchar | 10 | | YES | | | +| `mx_vgm` | decimal | | 18,6 | YES | | | +| `mx_vgm_cztype` | varchar | 100 | | YES | | | +| `mx_vgm_czdate` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | + +### bs_business_cw + +**主键:** subid + +**外键:** +- father -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `subxh` | int | | 10,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_bid` | varchar | 50 | | YES | | | +| `mx_level` | int | | 10,0 | NO | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_dw_id` | bigint | | 19,0 | YES | | | +| `mx_dw_name` | nvarchar | 50 | | YES | | | +| `mx_direction` | varchar | 20 | | YES | | | +| `mx_feetype_id` | bigint | | 19,0 | YES | | | +| `mx_feetype_name` | nvarchar | 50 | | YES | | | +| `mx_moneytype_id` | bigint | | 19,0 | YES | | | +| `mx_hstype_id` | bigint | | 19,0 | YES | | | +| `mx_price` | decimal | | 18,2 | YES | | | +| `mx_qty` | decimal | | 18,3 | YES | | | +| `mx_amount` | decimal | | 18,3 | YES | | | +| `mx_amount_rmb` | decimal | | 18,3 | YES | | | +| `mx_exrate` | decimal | | 18,4 | YES | | | +| `mx_log_flag` | varchar | 50 | | YES | | | +| `mx_tax` | decimal | | 18,4 | YES | | | +| `mx_invoicenotax` | decimal | | 18,3 | YES | | | +| `mx_invoicetax` | decimal | | 18,3 | YES | | | +| `mx_sh_check` | varchar | 1 | | YES | | | +| `mx_sh_datetime` | datetime2 | | | YES | | | +| `mx_shman_id` | bigint | | 19,0 | YES | | | +| `mx_cwgz_check` | varchar | 50 | | YES | | | +| `mx_cwgz_datetime` | datetime2 | | | YES | | | +| `mx_cwgzman_id` | bigint | | 19,0 | YES | | | +| `mx_bill_id` | bigint | | 19,0 | YES | | | +| `mx_bill_ywno` | varchar | 50 | | YES | | | +| `mx_bill_updatedatetime` | datetime2 | | | YES | | | +| `mx_bill_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_bill_state` | varchar | 1 | | YES | | | +| `mx_bill_totalamount` | decimal | | 18,3 | YES | | | +| `mx_bill_totalamount_not` | decimal | | 18,3 | YES | | | +| `mx_invoice_id` | bigint | | 19,0 | YES | | | +| `mx_invoice_ywno` | varchar | 50 | | YES | | | +| `mx_invoice_updatedatetime` | datetime2 | | | YES | | | +| `mx_invoice_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_invoice_state` | varchar | 1 | | YES | | | +| `mx_invoice_totalamount` | decimal | | 18,3 | YES | | | +| `mx_invoice_totalamount_not` | decimal | | 18,3 | YES | | | +| `mx_sfd_id` | bigint | | 19,0 | YES | | | +| `mx_sfd_ywno` | varchar | 50 | | YES | | | +| `mx_sfd_updatedatetime` | datetime2 | | | YES | | | +| `mx_sfd_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_sfd_state` | varchar | 1 | | YES | | | +| `mx_sfd_totalamount` | decimal | | 18,3 | YES | | | +| `mx_sfd_totalamount_not` | decimal | | 18,3 | YES | | | +| `mx_mycompany_id` | bigint | | 19,0 | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | +| `mx_memo1` | nvarchar | 1000 | | YES | | | +| `mx_memo2` | nvarchar | 1000 | | YES | | | +| `mx_memo3` | nvarchar | 1000 | | YES | | | +| `mx_memo4` | nvarchar | 1000 | | YES | | | +| `mx_memo5` | nvarchar | 1000 | | YES | | | +| `mx_varchar_1` | varchar | 50 | | YES | | | +| `mx_varchar_2` | varchar | 50 | | YES | | | +| `mx_varchar_3` | varchar | 50 | | YES | | | +| `mx_varchar_4` | varchar | 50 | | YES | | | +| `mx_varchar_5` | varchar | 50 | | YES | | | +| `mx_con_no` | varchar | 50 | | YES | | | +| `mx_qty_type` | varchar | 50 | | YES | | | + +### bs_business_hdbl + +**主键:** subid + +**外键:** +- father -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_blno` | varchar | 50 | | YES | | | +| `mx_shippermemo` | nvarchar | 2000 | | YES | | | +| `mx_consigneememo` | nvarchar | 2000 | | YES | | | +| `mx_notifymemo` | nvarchar | 2000 | | YES | | | +| `mx_agentcompanyMemo` | nvarchar | 2000 | | YES | | | +| `mx_freightpayment` | varchar | 50 | | YES | | | +| `mx_namegoods` | nvarchar | 4000 | | YES | | | +| `mx_ctns` | int | | 10,0 | YES | | | +| `mx_ctns_unit_id` | bigint | | 19,0 | YES | | | +| `mx_gw` | decimal | | 18,3 | YES | | | +| `mx_vol` | decimal | | 18,3 | YES | | | +| `mx_bz1` | nvarchar | 3000 | | YES | | | +| `mx_bz2` | nvarchar | 100 | | YES | | | +| `mx_bz3` | nvarchar | 100 | | YES | | | +| `mx_bz4` | nvarchar | 100 | | YES | | | +| `mx_bz5` | nvarchar | 100 | | YES | | | +| `mx_transterm` | varchar | 50 | | YES | | | +| `mx_drno` | varchar | 50 | | YES | | | +| `mx_aimport_id` | bigint | | 19,0 | YES | | | +| `mx_shipmark` | nvarchar | 2000 | | YES | | | +| `mx_loadport_id` | bigint | | 19,0 | YES | | | +| `mx_transport_id` | bigint | | 19,0 | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | + +### bs_business_hdbl_sub + +**主键:** subid + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_con_no` | varchar | 50 | | YES | | | +| `mx_blno` | varchar | 50 | | YES | | | +| `mx_con_cartons` | int | | 10,0 | YES | | | +| `mx_con_gw` | decimal | | 18,6 | YES | | | +| `mx_con_nw` | decimal | | 18,6 | YES | | | +| `mx_con_vol` | decimal | | 18,6 | YES | | | +| `mx_bz1` | nvarchar | 3000 | | YES | | | +| `mx_bz2` | nvarchar | 100 | | YES | | | +| `mx_bz3` | nvarchar | 100 | | YES | | | +| `mx_bz4` | nvarchar | 100 | | YES | | | +| `mx_bz5` | nvarchar | 100 | | YES | | | +| `mx_linkfd_id` | bigint | | 19,0 | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | + +### bs_business_transport + +**主键:** subid + +**外键:** +- father -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_source_type` | varchar | 50 | | YES | | | +| `mx_keyid` | varchar | 50 | | YES | | | +| `mx_processtype` | varchar | 50 | | YES | | | +| `mx_transtype` | varchar | 50 | | YES | | | +| `mx_loadport` | varchar | 50 | | YES | | | +| `mx_aimport` | varchar | 50 | | YES | | | +| `mx_ETD` | datetime2 | | | YES | | | +| `mx_ETA` | datetime2 | | | YES | | | +| `mx_truck_id` | bigint | | 19,0 | YES | | | +| `mx_truckno` | varchar | 50 | | YES | | | +| `mx_pno` | varchar | 50 | | YES | | | +| `mx_bz` | nvarchar | 200 | | YES | | | +| `mx_startdate` | datetime2 | | | YES | | | +| `mx_finish` | int | | 10,0 | NO | ((0)) | | +| `mx_finishdate` | datetime2 | | | YES | | | +| `mx_finish_userid` | bigint | | 19,0 | YES | | | +| `mx_manage_id` | bigint | | 19,0 | YES | | | +| `mx_user_id` | bigint | | 19,0 | YES | | | +| `mx_varcahr1` | varchar | 50 | | YES | | | +| `mx_varcahr2` | varchar | 50 | | YES | | | +| `mx_varcahr3` | varchar | 50 | | YES | | | +| `mx_bz1` | nvarchar | 300 | | YES | | | +| `mx_bz2` | nvarchar | 300 | | YES | | | +| `mx_bz3` | nvarchar | 300 | | YES | | | +| `mx_jhdatetime` | datetime2 | | | YES | | | +| `mx_level` | varchar | 50 | | YES | | | +| `mx_state` | varchar | 50 | | YES | | | +| `mx_vessel_voy` | varchar | 150 | | YES | | | +| `mx_lastupdate_datatime` | datetime2 | | | YES | | | +| `mx_attach_bz1` | nvarchar | 300 | | YES | | | +| `mx_attach_bz2` | nvarchar | 300 | | YES | | | +| `mx_attach_bz3` | nvarchar | 300 | | YES | | | +| `mx_packdate` | datetime2 | | | YES | | | +| `mx_packplace` | nvarchar | 300 | | YES | | | +| `mx_txdate` | datetime2 | | | YES | | | +| `mx_txplace` | nvarchar | 300 | | YES | | | +| `mx_hxdate` | datetime2 | | | YES | | | +| `mx_hxplace` | nvarchar | 300 | | YES | | | +| `mx_conno` | varchar | 3000 | | YES | | | +| `mx_inputuser_id` | bigint | | 19,0 | YES | | | +| `mx_inputdatetime` | datetime2 | | | YES | | | +| `mx_updateuser_id` | bigint | | 19,0 | YES | | | +| `mx_updatedatetime` | datetime2 | | | YES | | | + +### cw_account + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 500 | | YES | | | +| `b_type` | varchar | 200 | | YES | | | +| `b_bank` | nvarchar | 200 | | YES | | | +| `b_account` | varchar | 200 | | NO | | | +| `b_date` | datetime2 | | | YES | | | +| `b_amount_start` | decimal | | 18,2 | YES | | | +| `b_amount` | decimal | | 18,2 | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_truckno` | varchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | + +### cw_account_type + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 50 | | YES | | | +| `b_bz` | nvarchar | 50 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### cw_bill + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_ywno` | varchar | 50 | | NO | | | +| `b_date` | datetime2 | | | YES | | | +| `b_direction` | varchar | 20 | | YES | | | +| `b_document_type` | varchar | 50 | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_amount` | decimal | | 18,2 | YES | | | +| `b_amount_desc` | nvarchar | 500 | | YES | | | +| `b_money_id` | bigint | | 19,0 | YES | | | +| `b_account_id` | bigint | | 19,0 | YES | | | +| `b_bankname` | nvarchar | 100 | | YES | | | +| `b_bankaccount` | nvarchar | 500 | | YES | | | +| `b_zl` | decimal | | 18,0 | YES | | | +| `b_plandate` | datetime2 | | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_writeoff` | varchar | 50 | | YES | | | +| `b_writeoff_id` | bigint | | 19,0 | YES | | | +| `b_writeoffdatetime` | datetime2 | | | YES | | | +| `b_dw_bankacount` | nvarchar | 500 | | YES | | | +| `b_dw_invaccount` | varchar | 500 | | YES | | | +| `b_my_bankacount` | nvarchar | 500 | | YES | | | +| `b_my_invaccount` | varchar | 500 | | YES | | | + +### cw_bill_business + +**主键:** subid + +**外键:** +- b_bill_id -> cw_bill(b_id) +- b_business_id -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_bill_id` | bigint | | 19,0 | NO | | | +| `b_business_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_billsub + +**主键:** subid + +**外键:** +- father -> cw_bill(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_fee_id` | bigint | | 19,0 | YES | | | +| `mx_fee_money_id` | bigint | | 19,0 | YES | | | +| `mx_fee_amount` | decimal | | 18,2 | YES | | | +| `mx_bill_amount` | decimal | | 18,2 | YES | | | +| `mx_bz` | nvarchar | 200 | | YES | | | + +### cw_daily + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_date` | datetime2 | | | YES | | | +| `b_bill` | int | | 10,0 | NO | ((0)) | | +| `b_feetype` | varchar | 50 | | YES | | | +| `b_amount` | decimal | | 18,2 | YES | | | +| `b_bz1` | nvarchar | 500 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_payee_id` | bigint | | 19,0 | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_desc` | nvarchar | 500 | | YES | | | +| `b_type` | varchar | 50 | | YES | | | +| `b_account_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_zx` | int | | 10,0 | NO | ((0)) | | +| `b_zxuser_id` | bigint | | 19,0 | YES | | | +| `b_zxdatetime` | datetime2 | | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### cw_invoice + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_ywno` | varchar | 50 | | NO | | | +| `b_date` | datetime2 | | | YES | | | +| `b_direction` | varchar | 20 | | YES | | | +| `b_document_type` | varchar | 50 | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_amount` | decimal | | 18,2 | YES | | | +| `b_money_id` | bigint | | 19,0 | YES | | | +| `b_account_id` | bigint | | 19,0 | YES | | | +| `b_bankname` | nvarchar | 100 | | YES | | | +| `b_bankaccount` | nvarchar | 500 | | YES | | | +| `b_tax` | varchar | 50 | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_bz1` | nvarchar | 500 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_writeoff` | varchar | 50 | | YES | | | +| `b_writeoff_id` | bigint | | 19,0 | YES | | | +| `b_writeoffdatetime` | datetime2 | | | YES | | | +| `b_dw_bankacount` | nvarchar | 500 | | YES | | | +| `b_dw_invaccount` | varchar | 500 | | YES | | | +| `b_my_bankacount` | nvarchar | 500 | | YES | | | +| `b_my_invaccount` | varchar | 500 | | YES | | | + +### cw_invoice_bill + +**主键:** subid + +**外键:** +- b_invoice_id -> cw_invoice(b_id) +- b_bill_id -> cw_bill(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_invoice_id` | bigint | | 19,0 | NO | | | +| `b_bill_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_invoice_business + +**主键:** subid + +**外键:** +- b_invoice_id -> cw_invoice(b_id) +- b_business_id -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_invoice_id` | bigint | | 19,0 | NO | | | +| `b_business_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_invoicesub + +**主键:** subid + +**外键:** +- father -> cw_invoice(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_fee_id` | bigint | | 19,0 | YES | | | +| `mx_fee_money_id` | bigint | | 19,0 | YES | | | +| `mx_fee_amount` | decimal | | 18,2 | YES | | | +| `mx_invoice_amount` | decimal | | 18,2 | YES | | | +| `mx_bz` | nvarchar | 50 | | YES | | | + +### cw_sfd + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_ywno` | varchar | 50 | | NO | | | +| `b_direction` | varchar | 20 | | YES | | | +| `b_document_type` | varchar | 50 | | YES | | | +| `b_date` | datetime2 | | | YES | | | +| `b_dw_id` | bigint | | 19,0 | YES | | | +| `b_mycompany_id` | bigint | | 19,0 | YES | | | +| `b_amount` | decimal | | 18,3 | YES | | | +| `b_amount_other` | decimal | | 18,3 | YES | | | +| `b_amount_sj` | decimal | | 18,3 | YES | | | +| `b_money_id` | bigint | | 19,0 | YES | | | +| `b_exrate` | decimal | | 18,4 | YES | | | +| `b_amount_hx` | decimal | | 18,3 | YES | | | +| `b_amount_nothx` | decimal | | 18,3 | YES | | | +| `b_account_id` | bigint | | 19,0 | YES | | | +| `b_bankname` | nvarchar | 100 | | YES | | | +| `b_bankaccount` | nvarchar | 500 | | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_bz` | nvarchar | 500 | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_sh` | int | | 10,0 | NO | ((0)) | | +| `b_sh_id` | bigint | | 19,0 | YES | | | +| `b_shdatetime` | datetime2 | | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_writeoff` | varchar | 50 | | YES | | | +| `b_writeoff_id` | bigint | | 19,0 | YES | | | +| `b_writeoffdatetime` | datetime2 | | | YES | | | + +### cw_sfd_bill + +**主键:** subid + +**外键:** +- b_sfd_id -> cw_sfd(b_id) +- b_bill_id -> cw_bill(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_sfd_id` | bigint | | 19,0 | NO | | | +| `b_bill_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_sfd_business + +**主键:** subid + +**外键:** +- b_sfd_id -> cw_sfd(b_id) +- b_business_id -> bs_business(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_sfd_id` | bigint | | 19,0 | NO | | | +| `b_business_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_sfd_invoice + +**主键:** subid + +**外键:** +- b_sfd_id -> cw_sfd(b_id) +- b_invoice_id -> cw_invoice(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `b_sfd_id` | bigint | | 19,0 | NO | | | +| `b_invoice_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### cw_sfdsub + +**主键:** subid + +**外键:** +- father -> cw_sfd(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | int | | 10,0 | YES | | | +| `mx_fee_id` | bigint | | 19,0 | YES | | | +| `mx_fee_money_id` | bigint | | 19,0 | YES | | | +| `mx_fee_amount` | decimal | | 18,2 | YES | | | +| `mx_sf_money_id` | bigint | | 19,0 | YES | | | +| `mx_sf_amount` | decimal | | 18,2 | YES | | | +| `mx_exrate` | decimal | | 18,4 | YES | | | +| `mx_bz` | nvarchar | 50 | | YES | | | + +### oa_notices + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_subject` | nvarchar | 250 | | YES | | | +| `b_info` | nvarchar | MAX | | YES | | | +| `b_inputdate` | datetime2 | | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_toall` | int | | 10,0 | NO | ((0)) | | +| `b_order` | int | | 10,0 | YES | | | +| `b_visible` | int | | 10,0 | NO | ((1)) | | +| `b_body` | varbinary | MAX | | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_state` | varchar | 50 | | YES | | | +| `b_dl_id` | bigint | | 19,0 | YES | | | +| `b_xl_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### oa_notices_attach + +**主键:** SubID + +**外键:** +- father -> oa_notices(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `SubID` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_attachname` | nvarchar | 500 | | YES | | | +| `mx_attachfile` | varbinary | MAX | | YES | | | +| `mx_contentid` | nvarchar | 500 | | YES | | | +| `mx_attachsize` | varchar | 50 | | YES | | | +| `mx_ifattachfile` | varchar | 500 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### oa_notices_dl + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_name` | nvarchar | 100 | | YES | | | +| `b_bz` | nvarchar | 100 | | YES | | | +| `b_xh` | int | | 10,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### oa_notices_xl + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_xh` | int | | 10,0 | YES | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_name` | nvarchar | 100 | | YES | | | +| `b_father_id` | bigint | | 19,0 | YES | | | +| `b_bz` | nvarchar | 100 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### oa_noticesSub + +**主键:** subid + +**外键:** +- father -> oa_notices(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `subid` | bigint | | 19,0 | NO | | | +| `father` | bigint | | 19,0 | YES | | | +| `mx_xh` | varchar | 50 | | YES | | | +| `mx_user_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### oa_reminder + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_subject` | nvarchar | 250 | | YES | | | +| `b_content` | nvarchar | MAX | | YES | | | +| `b_datebegin` | datetime2 | | | YES | | | +| `b_reminder` | int | | 10,0 | NO | ((0)) | | +| `b_reminderday` | int | | 10,0 | YES | | | +| `b_customer_id` | bigint | | 19,0 | YES | | | +| `b_owner_id` | bigint | | 19,0 | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### oa_title + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_subject` | nvarchar | 250 | | YES | | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdate` | datetime2 | | | YES | | | +| `b_inputtime` | time | | | YES | | | +| `b_order` | int | | 10,0 | NO | | | +| `b_content` | nvarchar | MAX | | YES | | | +| `b_cate_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | YES | | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | +| `b_code` | varchar | 50 | | NO | | | + +### oa_title_bmfl + +**主键:** b_id + +**外键:** +- b_parent_id -> oa_title_bmfl(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_parent_id` | bigint | | 19,0 | YES | | | +| `b_name` | nvarchar | 150 | | NO | | | +| `b_level` | int | | 10,0 | NO | ((1)) | | +| `b_path` | varchar | 1000 | | NO | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_inputuser_id` | bigint | | 19,0 | YES | | | +| `b_inputdatetime` | datetime2 | | | NO | (sysdatetime()) | | +| `b_updateuser_id` | bigint | | 19,0 | YES | | | +| `b_updatedatetime` | datetime2 | | | YES | | | + +### s_login_log + +**主键:** b_id + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_org_id` | nvarchar | 50 | | YES | | | +| `b_user_id` | bigint | | 19,0 | YES | | | +| `b_account` | nvarchar | 50 | | YES | | | +| `b_login_time` | datetime | | | NO | (getdate()) | | +| `b_ip` | nvarchar | 50 | | YES | | | +| `b_ip_location` | nvarchar | 200 | | YES | | | +| `b_browser` | nvarchar | 100 | | YES | | | +| `b_browser_version` | nvarchar | 50 | | YES | | | +| `b_os` | nvarchar | 100 | | YES | | | +| `b_os_version` | nvarchar | 50 | | YES | | | +| `b_device_type` | nvarchar | 20 | | YES | | | +| `b_user_agent` | nvarchar | MAX | | YES | | | +| `b_login_result` | int | | 10,0 | NO | ((0)) | | +| `b_fail_reason` | nvarchar | 200 | | YES | | | +| `b_session_id` | nvarchar | 50 | | YES | | | + +### s_module + +**主键:** b_id + +**外键:** +- b_parent_id -> s_module(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_parent_id` | bigint | | 19,0 | YES | | | +| `b_name` | nvarchar | 100 | | NO | | | +| `b_i18n` | varchar | 150 | | YES | | | +| `b_module_type` | varchar | 20 | | NO | | | +| `b_route` | varchar | 200 | | YES | | | +| `b_viewtable` | varchar | 128 | | YES | | | +| `b_savetable` | varchar | 128 | | YES | | | +| `b_keyfield` | varchar | 50 | | YES | | | +| `b_orderfield` | varchar | 500 | | YES | | | +| `b_canmenu` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_icon` | varchar | 50 | | YES | | | + +### s_module_auto_code + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) +- b_field_id -> s_module_field(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_field_id` | bigint | | 19,0 | NO | | | +| `b_prefix` | nvarchar | 100 | | NO | (N'') | | +| `b_date_format` | varchar | 30 | | NO | ('yyyyMM') | | +| `b_separator` | nvarchar | 10 | | NO | (N'-') | | +| `b_sequence_width` | int | | 10,0 | NO | ((5)) | | +| `b_reset_type` | varchar | 10 | | NO | ('month') | | +| `b_start_value` | bigint | | 19,0 | NO | ((1)) | | +| `b_current_period` | varchar | 8 | | YES | | | +| `b_current_value` | bigint | | 19,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | + +### s_module_field + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_field` | varchar | 50 | | NO | | | +| `b_name` | nvarchar | 100 | | NO | | | +| `b_i18n` | varchar | 150 | | YES | | | +| `b_type` | varchar | 30 | | NO | | | +| `b_default_value` | nvarchar | 500 | | YES | | | +| `b_options` | nvarchar | MAX | | YES | | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | + +### s_module_field_edit + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) +- b_field_id -> s_module_field(b_id) +- b_group_id -> s_module_field_group(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_field_id` | bigint | | 19,0 | NO | | | +| `b_required` | int | | 10,0 | NO | ((0)) | | +| `b_readonly` | int | | 10,0 | NO | ((0)) | | +| `b_disabled` | int | | 10,0 | NO | ((0)) | | +| `b_visible` | int | | 10,0 | NO | ((1)) | | +| `b_group_id` | bigint | | 19,0 | YES | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | + +### s_module_field_group + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_parent_id` | bigint | | 19,0 | YES | | | +| `b_title` | nvarchar | 100 | | NO | | | +| `b_i18n` | varchar | 150 | | YES | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | + +### s_module_field_list + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) +- b_field_id -> s_module_field(b_id) +- b_group_id -> s_module_field_group(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_field_id` | bigint | | 19,0 | YES | | | +| `b_group_id` | bigint | | 19,0 | YES | | | +| `b_i18n` | varchar | 150 | | YES | | | +| `b_visible` | int | | 10,0 | NO | ((1)) | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_width` | int | | 10,0 | YES | | | + +### s_module_field_query + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) +- b_field_id -> s_module_field(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_field_id` | bigint | | 19,0 | NO | | | +| `b_component` | varchar | 30 | | NO | | | +| `b_operator` | varchar | 20 | | NO | | | +| `b_default_value` | nvarchar | 500 | | YES | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | + +### s_module_power + +**主键:** b_id + +**外键:** +- b_module_id -> s_module(b_id) + +| 字段名 | 类型 | 长度 | 精度,小数位 | 可空 | 默认值 | 备注 | +| --- | --- | --- | --- | --- | --- | --- | +| `b_id` | bigint | | 19,0 | NO | | | +| `b_module_id` | bigint | | 19,0 | NO | | | +| `b_code` | varchar | 50 | | NO | | | +| `b_name` | nvarchar | 100 | | NO | | | +| `b_i18n` | varchar | 150 | | YES | | | +| `b_xh` | int | | 10,0 | NO | ((0)) | | +| `b_canuse` | int | | 10,0 | NO | ((1)) | | + diff --git a/code/fms/fms-demo/index.html b/code/fms/fms-demo/index.html new file mode 100644 index 00000000..ad44af3d --- /dev/null +++ b/code/fms/fms-demo/index.html @@ -0,0 +1,655 @@ + + + + + +FMS 新系统 · 模块与菜单设计 Demo + + + + +
+ FMS 新系统 · 模块与菜单设计 + + +
orgId = SH01 · 售后技术 · 张工
+
+ +
+ +
+
+ + + +