Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
xingmin
yd-csf
Commits
f153c166
Commit
f153c166
authored
May 25, 2026
by
jianan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
应付明细17
parent
90c649e0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
15 deletions
+17
-15
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
+17
-15
No files found.
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
View file @
f153c166
...
...
@@ -388,32 +388,34 @@
<select
id=
"queryListStatistics"
resultType=
"com.yd.csf.service.vo.ExpectedFortuneStatisticsVO"
>
WITH filtered_data AS (
SELECT *
FROM expected_fortune
WHERE is_deleted = 0
AND is_part IN (0, 1)
SELECT
ef.hkd_amount,
ef.paid_amount,
ef.unpaid_amount,
ef.policy_no,
ef.default_exchange_rate
FROM expected_fortune ef
WHERE ef.is_deleted = 0
AND ef.is_part IN (0, 1)
<if
test=
"ew != null"
>
<if
test=
"ew.sqlSegment != null and ew.sqlSegment != ''"
>
AND ${ew.sqlSegment}
</if>
</if>
),
policy_premium AS (
SELECT
policy_no,
MIN(p.total_payment_premium * default_exchange_rate) AS premium_amount
FROM filtered_data
INNER JOIN policy p USING(policy_no)
GROUP BY policy_no
),
premium_total AS (
SELECT SUM(p.total_payment_premium * dp.default_exchange_rate) AS total_premium
FROM (SELECT DISTINCT policy_no, default_exchange_rate FROM filtered_data) dp
INNER JOIN policy p ON p.policy_no = dp.policy_no
)
SELECT
COALESCE(SUM(fd.hkd_amount), 0) AS totalExpectedAmount,
COALESCE(SUM(fd.paid_amount), 0) AS totalPaidAmount,
COALESCE(SUM(fd.unpaid_amount), 0) AS totalUnpaidAmount,
COALESCE(
SUM(pp.premium_amount)
, 0) AS totalPremiumAmount,
COALESCE(
pt.total_premium
, 0) AS totalPremiumAmount,
COUNT(DISTINCT fd.policy_no) AS totalPolicyCount
FROM filtered_data fd
LEFT JOIN policy_premium pp USING(policy_no)
FROM filtered_data fd
CROSS JOIN premium_total pt
</select>
<select
id=
"queryListNewCount"
resultType=
"java.lang.Long"
>
...
...
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