Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jiedao-api-boot-master
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lanbaoming
jiedao-api-boot-master
Commits
796c0fdf
Commit
796c0fdf
authored
Mar 25, 2025
by
332784038@qq.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sql脚本更新
parent
9eb49abf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
+6
-6
20250222-currency-rate.sql
sql/v2.2财务/20250222-currency-rate.sql
+6
-6
No files found.
sql/v2.2财务/20250222-currency-rate.sql
View file @
796c0fdf
...
...
@@ -116,14 +116,14 @@ ALTER TABLE `ecw_receipt_account` ADD COLUMN `collection_target_amount` DECIMAL(
ALTER
TABLE
`ecw_receipt_account`
ADD
COLUMN
`collection_target_currency_code`
varchar
(
255
)
DEFAULT
NULL
COMMENT
'收款支付币种代码'
AFTER
`target_amount`
;
UPDATE
`ecw_receipt_account`
r
left
join
(
SELECT
UPDATE
`ecw_receipt_account`
r
join
(
SELECT
ra
.
id
,
r1
.
source_amount
,
r1
.
source_currency_code
,
r1
.
target_amount
,
r1
.
target_currency_code
FROM
`ecw_receipt_account`
as
ra
left
JOIN
(
SELECT
rb
.
base_currency_id
as
base_currency_id
,
rb
.
receipt_id
as
receipt_id
FROM
`ecw_receivable`
rb
WHERE
rb
.
receipt_id
is
not
null
GROUP
BY
rb
.
base_currency_id
,
rb
.
receipt_id
)
as
rc
JOIN
(
SELECT
rb
.
base_currency_id
as
base_currency_id
,
rb
.
receipt_id
as
receipt_id
FROM
`ecw_receivable`
rb
WHERE
rb
.
receipt_id
is
not
null
GROUP
BY
rb
.
base_currency_id
,
rb
.
receipt_id
)
as
rc
on
rc
.
receipt_id
=
ra
.
receipt_id
JOIN
`ecw_currency_rate`
r1
ON
ra
.
currency_id
=
r1
.
source_id
...
...
@@ -138,15 +138,15 @@ UPDATE `ecw_receipt_account` r left join (SELECT
r
.
collection_target_amount
=
rs
.
target_amount
,
r
.
collection_target_currency_code
=
rs
.
target_currency_code
;
UPDATE
`ecw_receipt_account`
r
left
join
(
SELECT
UPDATE
`ecw_receipt_account`
r
join
(
SELECT
ra
.
id
FROM
`ecw_receipt_account`
as
ra
left
JOIN
(
SELECT
rb
.
base_currency_id
as
base_currency_id
,
rb
.
receipt_id
as
receipt_id
FROM
`ecw_receivable`
rb
WHERE
rb
.
receipt_id
is
not
null
GROUP
BY
rb
.
base_currency_id
,
rb
.
receipt_id
)
as
rc
JOIN
(
SELECT
rb
.
base_currency_id
as
base_currency_id
,
rb
.
receipt_id
as
receipt_id
FROM
`ecw_receivable`
rb
WHERE
rb
.
receipt_id
is
not
null
GROUP
BY
rb
.
base_currency_id
,
rb
.
receipt_id
)
as
rc
on
rc
.
receipt_id
=
ra
.
receipt_id
where
ra
.
currency_id
=
rc
.
base_currency_id
)
rs
on
rs
.
id
=
r
.
id
left
join
`ecw_currency`
c1
on
r
.
currency_id
=
c1
.
id
join
`ecw_currency`
c1
on
r
.
currency_id
=
c1
.
id
set
r
.
source_amount
=
1
,
r
.
`source_currency_code`
=
c1
.
fuhao
,
r
.
target_amount
=
1
,
...
...
@@ -164,7 +164,7 @@ ALTER TABLE `ecw_receipt_item` ADD COLUMN `target_currency_code` varchar(255) DE
update
`ecw_receipt_item`
ri
left
JOIN
(
JOIN
(
SELECT
ra
.
currency_id
as
currency_id
,
ra
.
receipt_id
as
receipt_id
,
ra
.
source_amount
as
source_amount
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment