Sfoglia il codice sorgente

feat: 增加基金管理页面返回最小净值日期

chenjianhua 5 mesi fa
parent
commit
4e639c3929

+ 5 - 0
service-base/src/main/java/com/simuwang/base/pojo/dos/FundInformationDO.java

@@ -52,6 +52,10 @@ public class FundInformationDO {
      */
     private String lastPriceDate;
     /**
+     * 初始净值日期
+     */
+    private String firstPriceDate;
+    /**
      * 净值报送频率,1-日频,2-周频,3-月频,4-季频,5-半年,6-年频
      */
     private Integer navFrequency;
@@ -84,6 +88,7 @@ public class FundInformationDO {
         vo.setFrequencyRemark(this.frequencyRemark);
         vo.setInceptionDate(this.inceptionDate);
         vo.setLastPriceDate(this.lastPriceDate);
+        vo.setFirstPriceDate(this.firstPriceDate);
         return vo;
     }
 }

+ 4 - 0
service-base/src/main/java/com/simuwang/base/pojo/vo/FundInformationVO.java

@@ -52,6 +52,10 @@ public class FundInformationVO {
      */
     private String lastPriceDate;
     /**
+     * 初始净值日期
+     */
+    private String firstPriceDate;
+    /**
      * 净值报送频率,1-日频,2-周频,3-月频,4-季频,5-半年,6-年频
      */
     private Integer navFrequency;

+ 13 - 0
service-base/src/main/resources/mapper/FundInfoMapper.xml

@@ -52,6 +52,7 @@
                c.credit_code as creditCode,
                f.inception_date as inceptionDate,
                n.last_price_date as lastPriceDate,
+               fn.first_price_date as firstPriceDate,
                r.nav_frequency as navFrequency,
                r.asset_Frequency as assetFrequency,
                r.valuation_Frequency as valuationFrequency,
@@ -60,6 +61,8 @@
         left join PPW_EMAIL.pvn_company_info c on f.trust_id = c.company_id and c.isvalid =1
         left join (select nv.fund_id,max(nv.price_date) as last_price_date from PPW_EMAIL.nav nv where nv.isvalid =1 group by nv.fund_id) n
         on f.fund_id = n .fund_id
+        left join (select fnv.fund_id,min(fnv.price_date) as first_price_date from PPW_EMAIL.nav fnv where fnv.isvalid =1 group by fnv.fund_id) fn
+        on f.fund_id = fn .fund_id
         left join PPW_EMAIL.fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
         where f.isvalid =1
         <if test="fundId != null and fundId !=''">
@@ -95,6 +98,14 @@
                 END,
                 a.lastPriceDate ${order}
             </when>
+            <when test="sort != null and sort !='' and sort=='firstPriceDate' and order != null and order !=''">
+                order by
+                CASE
+                WHEN a.firstPriceDate IS NULL THEN 1
+                ELSE 0
+                END,
+                a.firstPriceDate ${order}
+            </when>
             <otherwise>
                 order by a.lastPriceDate desc
             </otherwise>
@@ -144,6 +155,8 @@
         left join PPW_EMAIL.pvn_company_info c on f.trust_id = c.company_id and c.isvalid =1
         left join (select nv.fund_id,max(nv.price_date) as last_price_date from PPW_EMAIL.nav nv where nv.isvalid =1 group by nv.fund_id) n
         on f.fund_id = n .fund_id
+        left join (select fnv.fund_id,min(fnv.price_date) as first_price_date from PPW_EMAIL.nav fnv where fnv.isvalid =1 group by fnv.fund_id) fn
+        on f.fund_id = fn .fund_id
         left join PPW_EMAIL.fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
         where f.isvalid =1
         <if test="fundId != null and fundId !=''">