Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
doc
/
ht_project_doc
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 493e3bd0
authored
May 21, 2026
by
谢海旭
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
5.8.1 版本内容维护
1 parent
421b12cb
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
114 additions
and
0 deletions
13_v5.8.1_20260529/sql/DDL/scrm组dj_smartcarlife_ddl.sql
13_v5.8.1_20260529/sql/DML/scrm组dj_smartcarlife_dml.sql
13_v5.8.1_20260529/sql/DDL/scrm组dj_smartcarlife_ddl.sql
View file @
493e3bd
...
...
@@ -13,6 +13,36 @@
###
林永健
-----------------end---------------------
###
谢海旭
-----------------start-------------------
CREATE
TABLE
`supervisor_teaching_detail`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`task_id`
bigint
(
20
)
NOT
NULL
COMMENT
'关联任务ID(supervisor_task_info.id,task_type=5)'
,
`teaching_scene_code`
varchar
(
50
)
NOT
NULL
COMMENT
'带教场景编码(字典:teaching_scene)'
,
`teaching_scene_name`
varchar
(
50
)
NOT
NULL
COMMENT
'带教场景名称(线上/线下)'
,
`teaching_method_code`
varchar
(
50
)
NOT
NULL
COMMENT
'带教方式编码(字典:teaching_method)'
,
`teaching_method_name`
varchar
(
50
)
NOT
NULL
COMMENT
'带教方式名称'
,
`teaching_topic_code`
varchar
(
50
)
NOT
NULL
COMMENT
'带教主题编码(字典:teaching_topic)'
,
`teaching_topic_name`
varchar
(
50
)
NOT
NULL
COMMENT
'带教主题名称'
,
`teaching_time`
datetime
NOT
NULL
COMMENT
'带教时间'
,
PRIMARY
KEY
(
`id`
),
UNIQUE
KEY
`uk_task_id`
(
`task_id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'带教任务详情表'
;
CREATE
TABLE
`supervisor_task_participant`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`task_id`
bigint
(
20
)
NOT
NULL
COMMENT
'关联任务ID(supervisor_task_info.id)'
,
`participant_phone`
varchar
(
16
)
NOT
NULL
COMMENT
'参与人员手机号'
,
`participant_name`
varchar
(
64
)
NOT
NULL
COMMENT
'参与人员姓名'
,
`created_by`
varchar
(
50
)
NOT
NULL
COMMENT
'创建人'
,
`create_time`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_by`
varchar
(
50
)
DEFAULT
NULL
COMMENT
'更新人'
,
`updated_date`
datetime
DEFAULT
NULL
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
`deleted_flag`
char
(
1
)
NOT
NULL
DEFAULT
'N'
COMMENT
'删除标识(D:已删除;N:未删除)'
,
PRIMARY
KEY
(
`id`
),
KEY
`idx_task_id`
(
`task_id`
),
KEY
`idx_participant_phone`
(
`participant_phone`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'任务参与人员表'
;
###
谢海旭
-----------------end---------------------
###
杨卫
-----------------start--------------------
...
...
13_v5.8.1_20260529/sql/DML/scrm组dj_smartcarlife_dml.sql
View file @
493e3bd
###
谢海旭
-----------------start-------------------
-- 带教场景
INSERT
INTO
`dj_car_life_dict`
(
`business_code`
,
`type_code`
,
`type_name`
,
`item_name`
,
`item_value`
,
`sort_order`
,
`created_by`
,
`updated_by`
)
VALUES
(
'supervisor'
,
'teaching_scene'
,
'带教场景'
,
'线上'
,
'1'
,
1
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_scene'
,
'带教场景'
,
'线下'
,
'2'
,
2
,
'system'
,
'system'
);
-- 线上带教方式
INSERT
INTO
`dj_car_life_dict`
(
`business_code`
,
`type_code`
,
`type_name`
,
`item_name`
,
`item_value`
,
`sort_order`
,
`created_by`
,
`updated_by`
)
VALUES
(
'supervisor'
,
'teaching_method_1'
,
'线上带教方式'
,
'视频培训'
,
'1'
,
1
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_1'
,
'线上带教方式'
,
'语音培训'
,
'2'
,
2
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_1'
,
'线上带教方式'
,
'课程推送'
,
'3'
,
3
,
'system'
,
'system'
);
-- 线下带教方式
INSERT
INTO
`dj_car_life_dict`
(
`business_code`
,
`type_code`
,
`type_name`
,
`item_name`
,
`item_value`
,
`sort_order`
,
`created_by`
,
`updated_by`
)
VALUES
(
'supervisor'
,
'teaching_method_2'
,
'线下带教方式'
,
'陪同谈客'
,
'1'
,
1
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_2'
,
'线下带教方式'
,
'话术演练'
,
'2'
,
2
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_2'
,
'线下带教方式'
,
'知识赋能'
,
'3'
,
3
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_2'
,
'线下带教方式'
,
'心态疏导'
,
'4'
,
4
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_method_2'
,
'线下带教方式'
,
'新人带教'
,
'5'
,
5
,
'system'
,
'system'
);
-- 带教主题
INSERT
INTO
`dj_car_life_dict`
(
`business_code`
,
`type_code`
,
`type_name`
,
`item_name`
,
`item_value`
,
`sort_order`
,
`created_by`
,
`updated_by`
)
VALUES
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'新品知识培训'
,
'1'
,
1
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'销售话术'
,
'2'
,
2
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'产品卖点讲解'
,
'3'
,
3
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'竞品对比分析'
,
'4'
,
4
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'客户服务标准'
,
'5'
,
5
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'门店管理规范'
,
'6'
,
6
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'系统操作培训'
,
'7'
,
7
,
'system'
,
'system'
),
(
'supervisor'
,
'teaching_topic'
,
'带教主题'
,
'其他'
,
'99'
,
99
,
'system'
,
'system'
);
-- 历史数据处理
-- 将旧的带教数据(task_type=5)迁移到新增的详情表和参与人员表
-- 注意:旧数据中带教场景默认为"线上",带教方式为"课程推送",带教主题为"其他"
-- 1. 迁移到带教详情表
INSERT
INTO
`supervisor_teaching_detail`
(
task_id
,
teaching_scene_code
,
teaching_scene_name
,
teaching_method_code
,
teaching_method_name
,
teaching_topic_code
,
teaching_topic_name
,
teaching_time
)
SELECT
id
,
'1'
,
'线上'
,
'3'
,
'课程推送'
,
'99'
,
'其他'
,
create_time
FROM
`supervisor_task_info`
WHERE
deleted_flag
=
'N'
AND
task_type
=
5
AND
id
NOT
IN
(
SELECT
task_id
FROM
supervisor_teaching_detail
);
-- 2. 迁移参与人员(旧数据中只有一个参与人:store_manager_name/store_manager_phone)
INSERT
INTO
`supervisor_task_participant`
(
task_id
,
participant_phone
,
participant_name
,
created_by
)
SELECT
id
,
store_manager_phone
,
store_manager_name
,
created_by
FROM
`supervisor_task_info`
WHERE
deleted_flag
=
'N'
AND
task_type
=
5
AND
store_manager_phone
IS
NOT
NULL
AND
store_manager_phone
!=
''
AND
id
NOT
IN
(
SELECT
task_id
FROM
supervisor_task_participant
WHERE
deleted_flag
=
'N'
AND
task_id
=
supervisor_task_info
.
id
);
-- 3. 迁移门店关联数据(supervisor_task_merchant)
-- 旧数据中:merchant_id 和 merchant_name 字段存储的是单个门店信息
-- 需要将旧数据的门店信息迁移到门店关联表中
INSERT
INTO
`supervisor_task_merchant`
(
relation_id
,
merchant_id
,
merchant_name
,
created_by
)
SELECT
id
,
merchant_id
,
merchant_name
,
created_by
FROM
`supervisor_task_info`
WHERE
deleted_flag
=
'N'
AND
task_type
=
5
AND
merchant_id
IS
NOT
NULL
AND
id
NOT
IN
(
SELECT
relation_id
FROM
supervisor_task_merchant
WHERE
deleted_flag
=
'N'
);
###
谢海旭
-----------------end---------------------
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment