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")); + } +}