Browse Source

fix: 净值规模查询优化

chenjianhua 6 months ago
parent
commit
d27df07285

+ 9 - 22
service-base/src/main/resources/mapper/FundNavAssetMapper.xml

@@ -18,34 +18,22 @@
         info.fund_id,
         info.fund_short_name,
         info.register_number,
-        IFNULL(
         nav.price_date,
-        asset.price_date
-        ) AS price_date,
         nav.nav,
         nav.cumulative_nav_withdrawal,
         asset.asset_share,
         asset.asset_net,
-        CASE
-        WHEN nav.updatetime is null
-        THEN asset.updatetime
-        WHEN asset.updatetime is null
-        THEN nav.updatetime
-        WHEN asset.updatetime >= nav.updatetime
-        THEN asset.updatetime
-        ELSE nav.updatetime
-        END AS updatetime
+        nav.updatetime
         FROM
-        PPW_EMAIL.pvn_fund_info info
-        LEFT JOIN PPW_EMAIL.nav nav
+        PPW_EMAIL.nav nav
+        JOIN PPW_EMAIL.pvn_fund_info info
         ON info.fund_id = nav.fund_id
-        AND nav.isvalid = 1
         LEFT JOIN PPW_EMAIL.asset asset
-        ON info.fund_id = asset.fund_id
+        ON nav.fund_id = asset.fund_id
         AND nav.price_date = asset.price_date
         AND asset.isvalid = 1
         WHERE info.isvalid = 1
-        and (nav.nav is not null or asset.asset_share is not null or asset.asset_net is not null)
+        AND nav.isvalid = 1
         <if test="fundName != null and fundName !=''">
             and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
         </if>
@@ -75,16 +63,15 @@
             parameterType="com.simuwang.base.pojo.dto.query.FundNavAssetPageQuery">
         SELECT count(1)
         FROM
-        PPW_EMAIL.pvn_fund_info info
-        LEFT JOIN PPW_EMAIL.nav nav
+        PPW_EMAIL.nav nav
+        JOIN PPW_EMAIL.pvn_fund_info info
         ON info.fund_id = nav.fund_id
-        AND nav.isvalid = 1
         LEFT JOIN PPW_EMAIL.asset asset
-        ON info.fund_id = asset.fund_id
+        ON nav.fund_id = asset.fund_id
         AND nav.price_date = asset.price_date
         AND asset.isvalid = 1
         WHERE info.isvalid = 1
-        and (nav.nav is not null or asset.asset_share is not null or asset.asset_net is not null)
+        AND nav.isvalid = 1
         <if test="fundName != null and fundName !=''">
             and (info.fund_name like concat('%',#{fundName},'%') or info.fund_short_name like concat('%',#{fundName},'%') or info.register_number like concat('%',#{fundName},'%'))
         </if>

+ 3 - 3
service-manage/src/main/java/com/simuwang/manage/api/navAsset/FundNavAssetController.java

@@ -52,11 +52,11 @@ public class FundNavAssetController {
     }
 
     /**
-     * 新增基金规模
+     * 新增基金净值
      * @param fundNavVO
      * @return
      */
-    @SystemLog(value = "新增基金规模", type = SystemLog.Type.INSERT)
+    @SystemLog(value = "新增基金净值", type = SystemLog.Type.INSERT)
     @PostMapping("/save-fund-nav")
     public ResultVo saveFundNav(@RequestBody FundNavVO fundNavVO){
         fundNavAssetService.saveFundNav(fundNavVO);
@@ -70,7 +70,7 @@ public class FundNavAssetController {
     }
 
     /**
-     * 上传规模信息
+     * 上传净值规模
      * @param file
      * @param response
      * @param request