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 c5d827d3
authored
May 28, 2026
by
叶立庆
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
删除多余版本
1 parent
01a8db21
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
105 deletions
17_v5.8.2_20260615/sql/DDL/dj组dj_smartcarlife_ddl.sql
17_v5.8.2_20260615/sql/DML/dj组dj_smartcarlife_dml.sql
17_v5.8.2_20260615/sql/DDL/dj组dj_smartcarlife_ddl.sql
deleted
100644 → 0
View file @
01a8db2
###
陈希
-----------------start-------------------
###
陈希
-----------------end---------------------
###
立明
-----------------start-------------------
ALTER
TABLE
`dj_car_life_online_statement_account_trade_detail`
ADD
COLUMN
`division_order_code`
varchar
(
32
)
NULL
COMMENT
'分账单编号'
AFTER
`gl_division_money`
,
ADD
COLUMN
`reality_platform_merchant_id`
int
NULL
COMMENT
'实际分账平台方商户号'
AFTER
`division_date`
,
ADD
COLUMN
`reality_platform_merchant_name`
varchar
(
128
)
NULL
COMMENT
'实际分账平台方商户名称'
AFTER
`reality_platform_merchant_id`
,
ADD
COLUMN
`estimated_arrival_time`
varchar
(
10
)
NULL
COMMENT
'预计到账时间(分账日期+1个工作日)'
AFTER
`reality_platform_merchant_name`
,
ADD
INDEX
`idx_division_order_code`
(
`division_order_code`
);
CREATE
TABLE
`dj_car_life_online_statement_account_trade_distribution_detail`
(
`id`
int
(
11
)
NOT
NULL
AUTO_INCREMENT
COMMENT
'主键ID'
,
`trade_detail_id`
bigint
(
20
)
NOT
NULL
COMMENT
'线上对账单交易明细ID'
,
`target_merchant_type`
tinyint
(
2
)
NOT
NULL
COMMENT
'分配对象类型(1:平台方;2:服务商;3:4s店)'
,
`reality_merchant_id`
int
(
11
)
DEFAULT
NULL
COMMENT
'实际商户号'
,
`reality_merchant_name`
varchar
(
128
)
COLLATE
utf8mb4_unicode_ci
DEFAULT
NULL
COMMENT
'实际商户名称'
,
`division_money`
decimal
(
11
,
2
)
NOT
NULL
COMMENT
'分账金额'
,
`service_charge`
decimal
(
11
,
2
)
NOT
NULL
COMMENT
'手续费'
,
`created_by`
varchar
(
64
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'创建人'
,
`created_date`
datetime
NOT
NULL
COMMENT
'创建时间'
,
`updated_by`
varchar
(
64
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'修改人'
,
`updated_date`
datetime
NOT
NULL
COMMENT
'修改时间'
,
`deleted_flag`
char
(
1
)
COLLATE
utf8mb4_unicode_ci
NOT
NULL
COMMENT
'删除标示(D:已删除;N:未删除)'
,
PRIMARY
KEY
(
`id`
)
)
ENGINE
=
InnoDB
DEFAULT
CHARSET
=
utf8mb4
COLLATE
=
utf8mb4_unicode_ci
COMMENT
=
'商户分账分配'
;
###
立明
-----------------end---------------------
###
彦峰
-----------------start-------------------
###
彦峰
-----------------end---------------------
###
富康
-----------------start-------------------
###
富康
-----------------end---------------------
###
璐琦
-----------------start-------------------
###
璐琦
-----------------end---------------------
###
林冲
-----------------start--------------------
###
林冲
-----------------end----------------------
17_v5.8.2_20260615/sql/DML/dj组dj_smartcarlife_dml.sql
deleted
100644 → 0
View file @
01a8db2
###
陈希
-----------------start-------------------
###
陈希
-----------------end---------------------
###
立明
-----------------start-------------------
update
dj_car_life_online_statement_account_trade_detail
a
,
dj_car_life_order_division
b
set
a
.
reality_platform_merchant_id
=
b
.
reality_platform_merchant_id
,
a
.
reality_platform_merchant_name
=
b
.
reality_platform_merchant_name
,
a
.
division_order_code
=
b
.
division_order_code
where
a
.
pay_order_id
=
b
.
pay_order_id
and
a
.
deleted_flag
=
'N'
and
b
.
deleted_flag
=
'N'
and
b
.
division_type
=
2
and
b
.
division_status
=
3
and
a
.
division_order_code
is
null
;
update
dj_car_life_online_statement_account_trade_detail
a
,
dj_car_life_order_division
b
set
a
.
reality_platform_merchant_id
=
b
.
reality_platform_merchant_id
,
a
.
reality_platform_merchant_name
=
b
.
reality_platform_merchant_name
,
a
.
division_order_code
=
b
.
division_order_code
where
a
.
pay_order_id
=
b
.
pay_order_id
and
a
.
deleted_flag
=
'N'
and
b
.
deleted_flag
=
'N'
and
b
.
division_type
=
1
and
b
.
division_status
=
3
and
a
.
division_order_code
is
null
;
update
dj_car_life_online_statement_account_trade_detail
a
set
a
.
estimated_arrival_time
=
(
select
CONCAT
(
min
(
b
.
date
),
''
)
from
dj_car_life_month_work_day_record
b
where
b
.
deleted_flag
=
'N'
and
b
.
date
>
DATE_FORMAT
(
a
.
division_date
,
'%Y-%m-%d'
)
and
is_not_work
=
0
)
where
deleted_flag
=
'N'
and
a
.
estimated_arrival_time
is
null
and
a
.
division_date
is
not
null
;
insert
into
dj_car_life_online_statement_account_trade_distribution_detail
(
trade_detail_id
,
target_merchant_type
,
reality_merchant_id
,
reality_merchant_name
,
division_money
,
service_charge
,
created_by
,
created_date
,
updated_by
,
updated_date
,
deleted_flag
)
select
a
.
id
,
1
,
b
.
reality_platform_merchant_id
,
b
.
reality_platform_merchant_name
,
b
.
gl_division_money
,
if
(
b
.
djzhy_sub_merchant_id
is
not
null
and
b
.
djzhy_sub_merchant_id
=
b
.
fee_merchant_id
,
0
,
a
.
service_charge
),
'system'
,
NOW
(),
'system'
,
now
(),
'N'
from
dj_car_life_online_statement_account_trade_detail
a
join
dj_car_life_order_division
b
on
b
.
division_order_code
=
a
.
division_order_code
and
b
.
deleted_flag
=
'N'
where
a
.
deleted_flag
=
'N'
AND
b
.
gl_division_money
>
0
;
insert
into
dj_car_life_online_statement_account_trade_distribution_detail
(
trade_detail_id
,
target_merchant_type
,
reality_merchant_id
,
reality_merchant_name
,
division_money
,
service_charge
,
created_by
,
created_date
,
updated_by
,
updated_date
,
deleted_flag
)
select
a
.
id
,
4
,
b
.
djzhy_sub_merchant_id
,
b
.
djzhy_sub_merchant_name
,
b
.
djzhy_sub_merchant_division_money
,
if
(
b
.
djzhy_sub_merchant_id
is
not
null
and
b
.
djzhy_sub_merchant_id
=
b
.
fee_merchant_id
,
a
.
service_charge
,
0
),
'system'
,
NOW
(),
'system'
,
now
(),
'N'
from
dj_car_life_online_statement_account_trade_detail
a
join
dj_car_life_order_division
b
on
b
.
division_order_code
=
a
.
division_order_code
and
b
.
deleted_flag
=
'N'
where
a
.
deleted_flag
=
'N'
AND
b
.
djzhy_sub_merchant_division_money
>
0
;
insert
into
dj_car_life_online_statement_account_trade_distribution_detail
(
trade_detail_id
,
target_merchant_type
,
reality_merchant_id
,
reality_merchant_name
,
division_money
,
service_charge
,
created_by
,
created_date
,
updated_by
,
updated_date
,
deleted_flag
)
select
a
.
id
,
3
,
b
.
reality_shop_merchant_id
,
b
.
reality_shop_merchant_name
,
b
.
shop_division_money
,
0
,
'system'
,
NOW
(),
'system'
,
now
(),
'N'
from
dj_car_life_online_statement_account_trade_detail
a
join
dj_car_life_order_division
b
on
b
.
division_order_code
=
a
.
division_order_code
and
b
.
deleted_flag
=
'N'
where
a
.
deleted_flag
=
'N'
AND
b
.
shop_division_money
>
0
;
insert
into
dj_car_life_online_statement_account_trade_distribution_detail
(
trade_detail_id
,
target_merchant_type
,
reality_merchant_id
,
reality_merchant_name
,
division_money
,
service_charge
,
created_by
,
created_date
,
updated_by
,
updated_date
,
deleted_flag
)
select
a
.
id
,
2
,
b
.
reality_merchant_id
,
b
.
reality_merchant_name
,
b
.
division_money
,
0
,
'system'
,
NOW
(),
'system'
,
now
(),
'N'
from
dj_car_life_merchant_distribution
b
join
dj_car_life_online_statement_account_trade_detail
a
on
a
.
division_order_code
=
b
.
division_order_code
and
a
.
deleted_flag
=
'N'
where
b
.
deleted_flag
=
'N'
and
b
.
target_merchant_type
=
2
and
b
.
division_money
>
0
###
立明
-----------------end---------------------
###
彦峰
-----------------start-------------------
###
彦峰
-----------------end---------------------
###
富康
-----------------start-------------------
###
富康
-----------------end---------------------
###
璐琦
-----------------start-------------------
###
璐琦
-----------------end---------------------
###
林冲
-----------------start--------------------
###
林冲
-----------------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