From f23ef0a71242c6ccdd8c737d5da010d4d0e70c8d Mon Sep 17 00:00:00 2001 From: kangwenjing <1138819403@qq.com> Date: Mon, 29 Jun 2026 09:50:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E5=87=BA=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/opportunity/OpportunityMapper.xml | 2 ++ .../crm/mapper/OpportunityMapperSqlTest.java | 22 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 backend/src/test/java/com/unis/crm/mapper/OpportunityMapperSqlTest.java diff --git a/backend/src/main/resources/mapper/opportunity/OpportunityMapper.xml b/backend/src/main/resources/mapper/opportunity/OpportunityMapper.xml index e8068a9f..c0e2845a 100644 --- a/backend/src/main/resources/mapper/opportunity/OpportunityMapper.xml +++ b/backend/src/main/resources/mapper/opportunity/OpportunityMapper.xml @@ -112,6 +112,8 @@ coalesce(o.opportunity_type, '新建') as type, coalesce(o.archived, false) as archived, coalesce(o.pushed_to_oms, false) as pushedToOms, + o.actual_signed_amount as actualSignedAmount, + coalesce(o.is_poc, false) as isPoc, coalesce(o.product_type, 'VDI云桌面') as product, coalesce(o.source, '主动开发') as source, o.sales_expansion_id as salesExpansionId, diff --git a/backend/src/test/java/com/unis/crm/mapper/OpportunityMapperSqlTest.java b/backend/src/test/java/com/unis/crm/mapper/OpportunityMapperSqlTest.java new file mode 100644 index 00000000..b2f769a8 --- /dev/null +++ b/backend/src/test/java/com/unis/crm/mapper/OpportunityMapperSqlTest.java @@ -0,0 +1,22 @@ +package com.unis.crm.mapper; + +import static org.junit.jupiter.api.Assertions.assertTrue; + +import java.io.IOException; +import java.nio.charset.StandardCharsets; +import java.nio.file.Files; +import java.nio.file.Path; +import org.junit.jupiter.api.Test; + +class OpportunityMapperSqlTest { + + @Test + void selectOpportunities_shouldIncludeActualSignedAmountAndIsPocColumns() throws IOException { + String xml = Files.readString( + Path.of("src/main/resources/mapper/opportunity/OpportunityMapper.xml"), + StandardCharsets.UTF_8); + + assertTrue(xml.contains("o.actual_signed_amount as actualSignedAmount")); + assertTrue(xml.contains("coalesce(o.is_poc, false) as isPoc")); + } +}