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 3ad271e0
authored
Sep 15, 2026
by
chenxi
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交改动内容
1 parent
5362a702
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
0 deletions
27_v5.8.6_20260921/sql/DDL/dj_smartcarlife_ddl.sql
27_v5.8.6_20260921/sql/DML/dj_smartcarlife_dml.sql
27_v5.8.6_20260921/sql/DDL/dj_smartcarlife_ddl.sql
View file @
3ad271e
...
@@ -103,6 +103,13 @@ CREATE TABLE `rpt_report_store_daily`
...
@@ -103,6 +103,13 @@ CREATE TABLE `rpt_report_store_daily`
###
陈希
start
--------------------
###
陈希
start
--------------------
alter
table
dj_car_life_purchase_goods_log
alter
table
dj_car_life_purchase_goods_log
modify
column
log_content
varchar
(
255
)
not
null
comment
'日志内容'
;
modify
column
log_content
varchar
(
255
)
not
null
comment
'日志内容'
;
ALTER
TABLE
dj_car_life_stock_allocate_detail
ADD
COLUMN
upgrade_commodity_code
varchar
(
64
)
DEFAULT
NULL
COMMENT
'产品ID'
AFTER
goods_name
;
ALTER
TABLE
dj_car_life_purchase_order_delivery_detail
ADD
COLUMN
upgrade_commodity_code
varchar
(
64
)
DEFAULT
NULL
COMMENT
'产品ID'
AFTER
upgrade_goods_id
;
###
陈希
-----------------end----------------------
###
陈希
-----------------end----------------------
...
...
27_v5.8.6_20260921/sql/DML/dj_smartcarlife_dml.sql
View file @
3ad271e
...
@@ -45,3 +45,25 @@ UPDATE dj_car_life_base_goods bg
...
@@ -45,3 +45,25 @@ UPDATE dj_car_life_base_goods bg
WHERE
bg
.
status
<>
CASE
WHEN
t
.
on_shelf_cnt
=
0
THEN
0
WHERE
bg
.
status
<>
CASE
WHEN
t
.
on_shelf_cnt
=
0
THEN
0
WHEN
t
.
on_shelf_cnt
=
t
.
total_cnt
THEN
1
WHEN
t
.
on_shelf_cnt
=
t
.
total_cnt
THEN
1
ELSE
2
END
;
ELSE
2
END
;
-- 1 调拨单商品详情:取升级商品表
UPDATE
dj_car_life_stock_allocate_detail
sad
LEFT
JOIN
dj_car_life_upgrade_goods
ug
ON
ug
.
id
=
sad
.
goods_id
#
AND
ug
.
deleted_flag
=
'N'
SET
sad
.
upgrade_commodity_code
=
ug
.
commodity_code
WHERE
sad
.
deleted_flag
=
'N'
AND
(
sad
.
upgrade_commodity_code
IS
NULL
OR
sad
.
upgrade_commodity_code
=
''
);
-- 2 发货单商品详情-采购发货:取采购订单商品表
UPDATE
dj_car_life_purchase_order_delivery_detail
dd
LEFT
JOIN
dj_car_life_purchase_order_goods
og
ON
og
.
id
=
dd
.
purchase_order_goods_id
AND
og
.
deleted_flag
=
'N'
SET
dd
.
upgrade_commodity_code
=
og
.
upgrade_goods_commodity_code
WHERE
dd
.
deleted_flag
=
'N'
AND
dd
.
purchase_order_goods_id
IS
NOT
NULL
AND
(
dd
.
upgrade_commodity_code
IS
NULL
OR
dd
.
upgrade_commodity_code
=
''
);
-- 3 发货单商品详情-调拨发货:取调拨详情表(必须在 1 之后)
UPDATE
dj_car_life_purchase_order_delivery_detail
dd
LEFT
JOIN
dj_car_life_stock_allocate_detail
sad
ON
sad
.
id
=
dd
.
allocate_order_goods_id
AND
sad
.
deleted_flag
=
'N'
SET
dd
.
upgrade_commodity_code
=
sad
.
upgrade_commodity_code
WHERE
dd
.
deleted_flag
=
'N'
AND
dd
.
allocate_order_goods_id
IS
NOT
NULL
AND
(
dd
.
upgrade_commodity_code
IS
NULL
OR
dd
.
upgrade_commodity_code
=
''
);
\ 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