Browse Source

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

chenjianhua 5 months ago
parent
commit
65243ae29b

+ 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;

+ 40 - 27
service-base/src/main/resources/mapper/FundInfoMapper.xml

@@ -34,7 +34,7 @@
         select f.fund_id as "fundId",
         f.fund_short_name as "fundShortName",
         f.register_number as "registerNumber"
-        from pvn_fund_info f where f.isvalid =1
+        from PPW_EMAIL.pvn_fund_info f where f.isvalid =1
         <if test="keyword != null and keyword !=''">
             and (f.fund_name like concat('%',#{keyword},'%') or f.fund_short_name like concat('%',#{keyword},'%') or f.register_number like concat('%',#{keyword},'%') or f.fund_id like concat('%',#{keyword},'%'))
         </if>
@@ -52,15 +52,18 @@
                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,
                r.frequency_remark as frequencyRemark
-        from pvn_fund_info f
-        left join 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 nav nv where nv.isvalid =1 group by nv.fund_id) n
+        from PPW_EMAIL.pvn_fund_info f
+        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 fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
+        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 !=''">
             and f.fund_id like concat('%',#{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>
@@ -106,7 +117,7 @@
         select fund_id         as fundId,
                fund_name       as fundName,
                register_number as registerNumber
-        from pvn_fund_info
+        from PPW_EMAIL.pvn_fund_info
         where isvalid = 1
           and fund_name = #{fundName}
           and register_number = #{registerNumber}
@@ -116,7 +127,7 @@
         select fund_id         as fundId,
                fund_name       as fundName,
                register_number as registerNumber
-        from pvn_fund_info
+        from PPW_EMAIL.pvn_fund_info
         where isvalid = 1
           and fund_name = #{fundName}
     </select>
@@ -125,14 +136,14 @@
         select fund_id         as fundId,
                fund_name       as fundName,
                register_number as registerNumber
-        from pvn_fund_info
+        from PPW_EMAIL.pvn_fund_info
         where isvalid = 1
           and register_number = #{registerNumber}
     </select>
     <select id="countFundInfoByKeyword" resultType="java.lang.Long"
             parameterType="com.simuwang.base.pojo.dto.query.FundInputPageQuery">
         select count(f.fund_id)
-        from pvn_fund_info f where f.isvalid =1
+        from PPW_EMAIL.pvn_fund_info f where f.isvalid =1
         <if test="keyword != null and keyword !=''">
             and (f.fund_name like concat('%',#{keyword},'%') or f.fund_short_name like concat('%',#{keyword},'%') or f.register_number like concat('%',#{keyword},'%') or f.fund_id like concat('%',#{keyword},'%'))
         </if>
@@ -140,11 +151,13 @@
     <select id="countFundInfo" resultType="java.lang.Long"
             parameterType="com.simuwang.base.pojo.dto.query.FundInfoPageQuery">
         select count(f.fund_id)
-        from pvn_fund_info f
-        left join 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 nav nv where nv.isvalid =1 group by nv.fund_id) n
+        from PPW_EMAIL.pvn_fund_info f
+        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 fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
+        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 !=''">
             and f.fund_id like concat('%',#{fundId},'%')
@@ -172,28 +185,28 @@
         </if>
     </select>
     <select id="getFundNameByFundId" resultType="java.lang.String" parameterType="java.lang.String">
-        select fund_name from pvn_fund_info where fund_id=#{fundId} and isvalid=1
+        select fund_name from PPW_EMAIL.pvn_fund_info where fund_id=#{fundId} and isvalid=1
     </select>
     <select id="queryFundIdByName" resultType="java.lang.String" parameterType="java.lang.String">
         select fund_id
-        from pvn_fund_info
+        from PPW_EMAIL.pvn_fund_info
         where isvalid = 1
           and fund_name = #{fundName} limit 1
     </select>
     <select id="getCompanyNameByFundId" resultType="java.lang.String" parameterType="java.lang.String">
-        select c.company_name from pvn_company_info c
-        join pvn_fund_info info on info.trust_id=c.company_id
+        select c.company_name from PPW_EMAIL.pvn_company_info c
+        join PPW_EMAIL.pvn_fund_info info on info.trust_id=c.company_id
         where info.fund_id=#{fundId} and info.isvalid=1 and c.isvalid=1
     </select>
     <select id="getLiquidateDateByFundId" resultType="java.lang.String" parameterType="java.lang.String">
-        select liquidate_date from pvn_fund_info where fund_id=#{fundId} and isvalid=1
+        select liquidate_date from PPW_EMAIL.pvn_fund_info where fund_id=#{fundId} and isvalid=1
     </select>
     <select id="getFundIdByCompanyId" resultType="java.lang.String" parameterType="java.lang.String">
-        select info.fund_id from pvn_fund_info info join pvn_company_info c on info.trust_id=c.company_id
+        select info.fund_id from PPW_EMAIL.pvn_fund_info info join PPW_EMAIL.pvn_company_info c on info.trust_id=c.company_id
         where info.isvalid=1 and c.isvalid=1 and c.company_id=#{companyId}
     </select>
     <select id="getInceptionDateByFundId" resultType="java.lang.String" parameterType="java.lang.String">
-        select inception_date from pvn_fund_info where fund_id=#{fundId} and isvalid=1
+        select inception_date from PPW_EMAIL.pvn_fund_info where fund_id=#{fundId} and isvalid=1
     </select>
 
     <select id="queryFundAndTrustByRegisterNumber" resultType="com.simuwang.base.pojo.dos.FundAndCompanyInfoDO">
@@ -202,8 +215,8 @@
                t.register_number as registerNumber,
                t1.company_id as companyId,
                t1.company_name as companyName
-        from pvn_fund_info t
-            left join pvn_company_info t1 on t1.isvalid = 1 and t1.company_id = t.trust_id
+        from PPW_EMAIL.pvn_fund_info t
+            left join PPW_EMAIL.pvn_company_info t1 on t1.isvalid = 1 and t1.company_id = t.trust_id
         where t.isvalid = 1
           and t.register_number = #{registerNumber}
         limit 1
@@ -218,16 +231,16 @@
                info.is_amac_show,info.fund_status,info.amac_source_type,
                info.investment_type,info.liquidate_date,info.performance_start_date,
                info.is_shareclass,info.amac_url
-        from pvn_fund_info info
-        left join pvn_company_info a
+        from PPW_EMAIL.pvn_fund_info info
+        left join PPW_EMAIL.pvn_company_info a
                   on info.advisor_id = a.company_id and a.isvalid=1
-        left join pvn_company_info t
+        left join PPW_EMAIL.pvn_company_info t
                   on info.trust_id = t.company_id and t.isvalid=1
-        left join pvn_company_info ic
+        left join PPW_EMAIL.pvn_company_info ic
                   on info.issuer_id = ic.company_id and ic.isvalid=1
         where info.isvalid=1 and info.fund_id=#{fundId}
     </select>
     <select id="countFundTotal" resultType="java.lang.Long">
-        select count(1) from pvn_fund_info where isvalid=1
+        select count(1) from PPW_EMAIL.pvn_fund_info where isvalid=1
     </select>
 </mapper>