Files
GEAR-OA/script/sql/mysql/item/gear_contract.sql
2026-06-02 21:27:44 +08:00

36 lines
2.1 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

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

-- ================================
-- 合同编辑(用于“销售管理 -> 合同编辑详情”)
-- 目标:提供合同基础信息维护与快速编辑能力(列表行内修改/保存)
-- 说明:
-- 1) 单表存储合同主信息;与订单/客户关系后续可扩展
-- 2) 逻辑删除使用 del_flag0存在 2删除
-- ================================
DROP TABLE IF EXISTS gear_contract;
CREATE TABLE gear_contract (
contract_id bigint(20) NOT NULL COMMENT '合同ID',
contract_no varchar(64) NOT NULL COMMENT '合同号(唯一)',
party_a varchar(255) DEFAULT '' COMMENT '甲方/供方',
party_b varchar(255) DEFAULT '' COMMENT '乙方/需方',
effective_flag char(1) NOT NULL DEFAULT '0' COMMENT '是否生效0否 1是',
sign_date date COMMENT '签订日期',
delivery_date date COMMENT '交货日期',
sign_place varchar(255) DEFAULT '' COMMENT '签订地点',
party_a_address varchar(255) DEFAULT '' COMMENT '甲方地址',
party_b_address varchar(255) DEFAULT '' COMMENT '乙方地址',
remark varchar(500) DEFAULT NULL COMMENT '备注',
del_flag char(1) NOT NULL DEFAULT '0' COMMENT '删除标志0存在 2删除',
create_by varchar(64) DEFAULT '' COMMENT '创建者',
create_time datetime COMMENT '创建时间',
update_by varchar(64) DEFAULT '' COMMENT '更新者',
update_time datetime COMMENT '更新时间',
PRIMARY KEY (contract_id),
UNIQUE KEY uk_contract_no (contract_no),
KEY idx_sign_date (sign_date),
KEY idx_delivery_date (delivery_date),
KEY idx_effective_flag (effective_flag),
KEY idx_party_a (party_a),
KEY idx_party_b (party_b)
) ENGINE=InnoDB COMMENT='合同表(编辑详情)';