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 c36dfeca
authored
May 25, 2026
by
杨卫
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
doc:五月小版本sql脚本提交
1 parent
e15de312
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 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 @
c36dfec
...
@@ -83,6 +83,46 @@ CREATE TABLE `supervisor_task_participant` (
...
@@ -83,6 +83,46 @@ CREATE TABLE `supervisor_task_participant` (
###
谢海旭
-----------------end---------------------
###
谢海旭
-----------------end---------------------
###
杨卫
-----------------start--------------------
###
杨卫
-----------------start--------------------
-- ============================================
-- 202605小版本需求 - V2新表DDL
-- ============================================
-- 员工账号信息记录表(V2)
CREATE
TABLE
`dj_car_life_staff_account_assign_record`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`staff_uuid`
varchar
(
32
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'员工uuid'
,
`staff_phone`
varchar
(
20
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'驻店员工手机号'
,
`job_type`
tinyint
(
2
)
DEFAULT
NULL
COMMENT
'职级类型(0:实习生(理论),1:实习生(实践),2:初级驻店,3:中级驻店,4:高级驻店,5:小店长,6:大店长,7:初级区域督导,8:中级区域督导,9:高级区域督导)'
,
`staff_scene_label`
varchar
(
64
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'员工业务标签(多个用逗号分隔,0:权益+延保,1:轻改)'
,
`merchant_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'初始归属门店商户号'
,
`merchant_name`
varchar
(
128
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'初始归属门店商户名称'
,
`yq_merchant_id`
int
(
11
)
NOT
NULL
COMMENT
'归属园区店商户号'
,
`yq_merchant_name`
varchar
(
128
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'归属园区店商户名称'
,
`created_source`
tinyint
(
2
)
DEFAULT
NULL
COMMENT
'创建来源(1:账户中心,2:SCRM,3:生意助手,4:门店助手,5:D+,6:生意助手员工版小程序)'
,
`created_by`
varchar
(
64
)
CHARACTER
SET
utf8
NOT
NULL
COMMENT
'创建人'
,
`created_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`updated_by`
varchar
(
64
)
CHARACTER
SET
utf8
NOT
NULL
COMMENT
'修改人'
,
`updated_date`
datetime
NOT
NULL
COMMENT
'修改时间'
,
`station_type`
tinyint
(
2
)
DEFAULT
NULL
COMMENT
'驻店类型(1:门店常驻, 2:临时调动支援)'
,
`deleted_flag`
char
(
1
)
CHARACTER
SET
utf8
NOT
NULL
DEFAULT
'N'
COMMENT
'删除标识(D:已删除;N:未删除;I:禁用)'
,
PRIMARY
KEY
(
`id`
),
KEY
`idx_staff_phone`
(
`staff_phone`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'员工账号信息记录(V2)'
;
-- 驻店-门店账号分配场景表(V2)
CREATE
TABLE
`dj_car_life_staff_account_assign_scene`
(
`id`
bigint
(
20
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`account_record_id`
int
(
11
)
NOT
NULL
COMMENT
'dj_car_life_staff_account_assign_record表id'
,
`base_scene_code`
varchar
(
32
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'场景标识'
,
`scene_type`
tinyint
(
1
)
DEFAULT
NULL
COMMENT
'原来的场景'
,
`deleted_flag`
char
(
1
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
DEFAULT
'N'
COMMENT
'删除标识'
,
`created_by`
varchar
(
32
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'创建人'
,
`created_date`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
COMMENT
'创建时间'
,
`updated_by`
varchar
(
32
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'更新人'
,
`updated_date`
datetime
NOT
NULL
DEFAULT
CURRENT_TIMESTAMP
ON
UPDATE
CURRENT_TIMESTAMP
COMMENT
'更新时间'
,
PRIMARY
KEY
(
`id`
),
KEY
`index_record_id`
(
`account_record_id`
)
)
ENGINE
=
InnoDB
AUTO_INCREMENT
=
1
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'驻店-门店账号分配场景表(V2)'
;
###
杨卫
-----------------end----------------------
###
杨卫
-----------------end----------------------
###
庞善天
-----------------start--------------------
###
庞善天
-----------------start--------------------
...
...
13_v5.8.1_20260529/sql/DML/scrm组dj_smartcarlife_dml.sql
View file @
c36dfec
...
@@ -91,3 +91,32 @@ UPDATE dj_car_life_vd_equity_order e
...
@@ -91,3 +91,32 @@ UPDATE dj_car_life_vd_equity_order e
WHERE
e
.
deleted_flag
=
'N'
;
WHERE
e
.
deleted_flag
=
'N'
;
###
庞善天
-----------------end---------------------
###
庞善天
-----------------end---------------------
###
杨卫
-----------------start-------------------
delete
from
dj_car_life_staff_account_assign_record
;
delete
from
dj_car_life_staff_account_assign_scene
;
insert
into
dj_car_life_staff_account_assign_record
(
id
,
staff_uuid
,
staff_phone
,
job_type
,
staff_scene_label
,
merchant_id
,
merchant_name
,
yq_merchant_id
,
yq_merchant_name
,
created_source
,
created_by
,
created_date
,
updated_by
,
updated_date
,
station_type
,
deleted_flag
)
select
id
,
staff_uuid
,
staff_phone
,
job_type
,
staff_scene_label
,
merchant_id
,
merchant_name
,
yq_merchant_id
,
yq_merchant_name
,
created_source
,
created_by
,
created_date
,
updated_by
,
updated_date
,
station_type
,
deleted_flag
from
dj_car_life_staff_account_record
where
merchant_id
is
not
null
and
merchant_name
is
not
null
and
deleted_flag
!=
'D'
;
insert
into
dj_car_life_staff_account_assign_scene
(
id
,
account_record_id
,
base_scene_code
,
scene_type
,
deleted_flag
,
created_by
,
created_date
,
updated_by
,
updated_date
)
select
id
,
account_record_id
,
base_scene_code
,
scene_type
,
deleted_flag
,
created_by
,
created_date
,
updated_by
,
updated_date
from
dj_car_life_staff_account_scene
where
deleted_flag
!=
'D'
;
-- 下架或者不存在的场景软删除
UPDATE
dj_car_life_staff_account_assign_scene
ss
INNER
JOIN
dj_car_life_staff_account_assign_record
sr
ON
ss
.
account_record_id
=
sr
.
id
SET
ss
.
deleted_flag
=
'D'
,
ss
.
updated_date
=
NOW
()
WHERE
ss
.
deleted_flag
=
'N'
AND
NOT
EXISTS
(
SELECT
1
FROM
dj_car_life_scene_merchant_ref_new
ref
WHERE
ref
.
main_merchant_id
=
sr
.
merchant_id
and
ref
.
sub_merchant_id
=
sr
.
yq_merchant_id
and
ref
.
sub_merchant_type
=
6
AND
ref
.
base_scene_code
=
ss
.
base_scene_code
AND
ref
.
main_merchant_type
=
2
AND
ref
.
deleted_flag
=
'N'
AND
ref
.
status
=
1
);
###
杨卫
-----------------end---------------------
\ No newline at end of file
\ 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