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
584cc003
Commit
584cc003
authored
May 06, 2026
by
zhangxingmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/test' into test
parents
8e9addf8
063addbd
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
92 additions
and
25 deletions
+92
-25
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
+4
-1
yd-csf-service/src/main/java/com/yd/csf/service/dao/ExpectedFortuneMapper.java
+15
-1
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
+7
-0
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
+14
-1
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
+52
-22
No files found.
yd-csf-api/src/main/java/com/yd/csf/api/service/impl/ApiExpectedFortuneServiceImpl.java
View file @
584cc003
...
...
@@ -982,9 +982,12 @@ public class ApiExpectedFortuneServiceImpl implements ApiExpectedFortuneService
long
startTime
=
System
.
currentTimeMillis
();
try
{
// 2. 构建查询条件
// 2. 构建查询条件
(不含 ORDER BY,因为 UNION ALL 在 XML 中有单独的 ORDER BY)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
=
this
.
getQueryWrapper
(
request
);
// 移除 QueryWrapper 中的排序,避免在 UNION ALL 的子查询中出现 ORDER BY
queryWrapper
.
getExpression
().
getOrderBy
().
clear
();
// 3. 查询分页列表(UNION ALL 查询,包含预计发佣和实际发佣)
IPage
<
ApiExpectedFortunePageResponse
>
iPage
=
iExpectedFortuneService
.
queryListNew
(
request
.
getPageNo
(),
...
...
yd-csf-service/src/main/java/com/yd/csf/service/dao/ExpectedFortuneMapper.java
View file @
584cc003
...
...
@@ -46,7 +46,21 @@ public interface ExpectedFortuneMapper extends BaseMapper<ExpectedFortune> {
*/
void
updateBatchByBizId
(
@Param
(
"expectedFortuneBizIdList"
)
List
<
String
>
expectedFortuneBizIdList
,
@Param
(
"status"
)
String
status
);
IPage
<
ApiExpectedFortunePageResponse
>
queryListNew
(
Integer
pageNo
,
Integer
pageSize
,
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
* 查询预计发佣和实际发佣的分页列表(手动分页)
* @param pageNo 页码(从 1 开始)
* @param pageSize 每页大小
* @param queryWrapper 查询条件
* @return 列表数据
*/
List
<
ApiExpectedFortunePageResponse
>
queryListNew
(
@Param
(
"pageNo"
)
Integer
pageNo
,
@Param
(
"pageSize"
)
Integer
pageSize
,
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
* 查询预计发佣和实际发佣的总记录数
* @param queryWrapper 查询条件
* @return 总记录数
*/
Long
queryListNewCount
(
@Param
(
"ew"
)
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
* 查询预计发佣和实际发佣的统计数据(使用 SQL 聚合)
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/IExpectedFortuneService.java
View file @
584cc003
...
...
@@ -58,6 +58,13 @@ public interface IExpectedFortuneService extends IService<ExpectedFortune> {
*/
String
getPayableNo
(
String
fortuneType
);
/**
* 查询预计发佣和实际发佣的分页列表(手动分页)
* @param pageNo 页码(从 1 开始)
* @param pageSize 每页大小
* @param queryWrapper 查询条件
* @return 分页结果
*/
IPage
<
ApiExpectedFortunePageResponse
>
queryListNew
(
Integer
pageNo
,
Integer
pageSize
,
QueryWrapper
<
ExpectedFortune
>
queryWrapper
);
/**
...
...
yd-csf-service/src/main/java/com/yd/csf/service/service/impl/ExpectedFortuneServiceImpl.java
View file @
584cc003
...
...
@@ -214,7 +214,20 @@ public class ExpectedFortuneServiceImpl extends ServiceImpl<ExpectedFortuneMappe
@Override
public
IPage
<
ApiExpectedFortunePageResponse
>
queryListNew
(
Integer
pageNo
,
Integer
pageSize
,
QueryWrapper
<
ExpectedFortune
>
queryWrapper
)
{
return
this
.
baseMapper
.
queryListNew
(
pageNo
,
pageSize
,
queryWrapper
);
// 1. 查询列表数据(手动分页)
List
<
ApiExpectedFortunePageResponse
>
records
=
this
.
baseMapper
.
queryListNew
(
pageNo
,
pageSize
,
queryWrapper
);
// 2. 查询总记录数
Long
total
=
this
.
baseMapper
.
queryListNewCount
(
queryWrapper
);
if
(
total
==
null
)
{
total
=
0L
;
}
// 3. 手动构建分页对象
Page
<
ApiExpectedFortunePageResponse
>
page
=
new
Page
<>(
pageNo
,
pageSize
,
total
);
page
.
setRecords
(
records
);
return
page
;
}
@Override
...
...
yd-csf-service/src/main/resources/mappers/ExpectedFortuneMapper.xml
View file @
584cc003
...
...
@@ -221,7 +221,7 @@
f.is_part,
f.payable_no,
f.policy_no,
f.
premium,
NULL as
premium,
f.policy_currency,
NULL as insurance_company_biz_id,
NULL as product_launch_biz_id,
...
...
@@ -278,31 +278,61 @@
<select
id=
"queryListStatistics"
resultType=
"com.yd.csf.service.vo.ExpectedFortuneStatisticsVO"
>
SELECT
COALESCE(SUM(ef.hkd_amount), 0) AS totalExpectedAmount,
COALESCE(SUM(ef.paid_amount), 0) AS totalPaidAmount,
COALESCE(SUM(ef.unpaid_amount), 0) AS totalUnpaidAmount,
COALESCE(
(SELECT SUM(p.total_payment_premium) * MAX(ef2.default_exchange_rate)
FROM expected_fortune ef2
LEFT JOIN policy p ON ef2.policy_no = p.policy_no
WHERE ef2.is_deleted = 0 AND ef2.is_part IN (0, 1)
<if
test=
"ew != null"
>
<if
test=
"ew.sqlSegment != null and ew.sqlSegment != ''"
>
AND ${ew.sqlSegment}
</if>
</if>
), 0
) AS totalPremiumAmount,
COUNT(DISTINCT ef.policy_no) AS totalPolicyCount
FROM expected_fortune ef
<where>
ef.is_deleted = 0
AND ef.is_part IN (0, 1)
COALESCE(SUM(hkd_amount), 0) AS totalExpectedAmount,
COALESCE(SUM(paid_amount), 0) AS totalPaidAmount,
COALESCE(SUM(unpaid_amount), 0) AS totalUnpaidAmount,
COALESCE(totalPremiumAmount, 0) AS totalPremiumAmount,
COUNT(DISTINCT policy_no) AS totalPolicyCount
FROM (
SELECT
ef.hkd_amount,
ef.paid_amount,
ef.unpaid_amount,
ef.policy_no,
(SELECT SUM(p.total_payment_premium) * MAX(ef.default_exchange_rate)
FROM policy p
WHERE p.policy_no = ef.policy_no
LIMIT 1
) AS totalPremiumAmount
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>
</where>
) AS statistics
</select>
<select
id=
"queryListNewCount"
resultType=
"java.lang.Long"
>
SELECT COUNT(*)
FROM (
SELECT ef.id
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>
</where>
UNION ALL
SELECT f.id
FROM fortune f
<where>
f.is_deleted = 0
AND f.is_part IN (0, 1)
<if
test=
"ew != null"
>
<if
test=
"ew.sqlSegment != null and ew.sqlSegment != ''"
>
AND ${ew.sqlSegment}
</if>
</if>
</where>
) AS combined
</select>
</mapper>
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