feat: CRM/合同管理 - SQL

plp
dhb52 2 years ago
parent eedb528412
commit 164be5732b

@ -0,0 +1,39 @@
SET NAMES utf8mb4;
-- ----------------------------
--
-- ----------------------------
DROP TABLE IF EXISTS `crm_contract`;
CREATE TABLE `crm_contract`
(
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '',
`name` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT '',
`customer_id` bigint DEFAULT NULL COMMENT '',
`business_id` bigint DEFAULT NULL COMMENT '',
`process_instance_id` bigint DEFAULT NULL COMMENT '',
`order_date` datetime DEFAULT NULL COMMENT '',
`owner_user_id` bigint DEFAULT NULL COMMENT '',
`no` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`start_time` datetime DEFAULT NULL COMMENT '',
`end_time` datetime DEFAULT NULL COMMENT '',
`price` int DEFAULT NULL COMMENT '',
`discount_percent` int DEFAULT NULL COMMENT '',
`product_price` int DEFAULT NULL COMMENT '',
`ro_user_ids` varchar(4096) DEFAULT NULL COMMENT '',
`rw_user_ids` varchar(4096) DEFAULT NULL COMMENT '',
`contact_id` bigint DEFAULT NULL COMMENT '',
`sign_user_id` bigint DEFAULT NULL COMMENT '',
`contact_last_time` datetime DEFAULT NULL COMMENT '',
--
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT NULL COMMENT '',
`creator` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '',
`create_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`updater` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NULL DEFAULT '' COMMENT '',
`update_time` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT '',
`deleted` bit(1) NOT NULL DEFAULT b'0' COMMENT '',
`tenant_id` bigint NOT NULL DEFAULT 0 COMMENT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB
CHARACTER SET = utf8mb4
COLLATE = utf8mb4_unicode_ci COMMENT ='';

@ -0,0 +1,63 @@
-- ----------------------------
--
-- ----------------------------
-- SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status, component_name
)
VALUES (
'', '', 2, 0, 1254,
'contract', '', 'crm/contract/index', 0, 'Contract'
);
-- ID
-- MySQL OraclePostgreSQLSQLServer @parentId
SELECT @parentId := LAST_INSERT_ID();
-- SQL
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'crm:contract:query', 3, 1, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'crm:contract:create', 3, 2, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'crm:contract:update', 3, 3, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'crm:contract:delete', 3, 4, @parentId,
'', '', '', 0
);
INSERT INTO system_menu(
name, permission, type, sort, parent_id,
path, icon, component, status
)
VALUES (
'', 'crm:contract:export', 3, 5, @parentId,
'', '', '', 0
);
-- ----------------------------
-- ...
-- ----------------------------

@ -0,0 +1,27 @@
CREATE TABLE IF NOT EXISTS "crm_contract" (
"id" bigint NOT NULL GENERATED BY DEFAULT AS IDENTITY,
"name" varchar NOT NULL,
"customer_id" bigint,
"business_id" bigint,
"process_instance_id" bigint,
"order_date" varchar,
"owner_user_id" bigint,
"no" varchar,
"start_time" varchar,
"end_time" varchar,
"price" int,
"discount_percent" int,
"product_price" int,
"ro_user_ids" varchar,
"rw_user_ids" varchar,
"contact_id" bigint,
"sign_user_id" bigint,
"contact_last_time" varchar,
"remark" varchar,
"creator" varchar DEFAULT '',
"create_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
"updater" varchar DEFAULT '',
"update_time" datetime NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
"deleted" bit NOT NULL DEFAULT FALSE,
PRIMARY KEY ("id")
) COMMENT '';
Loading…
Cancel
Save