瀏覽代碼

feat:公募基金基本信息接口的实现

mozuwen 1 年之前
父節點
當前提交
c0c59ba117

+ 128 - 0
src/main/java/com/smppw/analysis/application/service/info/FundInfoService.java

@@ -8,6 +8,7 @@ import cn.hutool.core.date.DateUtil;
 import cn.hutool.core.map.MapUtil;
 import cn.hutool.core.text.CharSequenceUtil;
 import cn.hutool.core.util.NumberUtil;
+import cn.hutool.core.util.ReflectUtil;
 import cn.hutool.core.util.StrUtil;
 import com.smppw.analysis.application.dto.info.FundSimilarReq;
 import com.smppw.analysis.application.dto.info.ManualFundManagerParams;
@@ -22,6 +23,7 @@ import com.smppw.common.pojo.IStrategy;
 import com.smppw.common.pojo.NewSubStrategy;
 import com.smppw.common.pojo.ValueLabelVO;
 import com.smppw.common.pojo.dto.DateValue;
+import com.smppw.common.pojo.dto.NewDateValue;
 import com.smppw.common.pojo.dto.calc.IndicatorCalcIndexDataDto;
 import com.smppw.common.pojo.dto.calc.IndicatorCalcPropertyDto;
 import com.smppw.common.pojo.dto.calc.IndicatorCalcSecDataDto;
@@ -53,6 +55,7 @@ public class FundInfoService {
     private static final Map<Integer, String> FUND_STATUS_MAP = MapUtil.newHashMap(11);
     private static final Map<Integer, String> FUND_TYPE_MAP = MapUtil.newHashMap(11);
     private static final Map<Integer, String> BASE_CURRENCY_MAP = MapUtil.newHashMap(5);
+    private static final Map<Integer, String> APPLYING_MARKET_MAP = MapUtil.newHashMap(3);
 
     static {
         ACCRUED_FREQUENCY.put("1", "月");
@@ -105,6 +108,10 @@ public class FundInfoService {
         FUND_TYPE_MAP.put(15, "公募基金 ");
         FUND_TYPE_MAP.put(-1, "其他");
 
+        APPLYING_MARKET_MAP.put(1,"场内");
+        APPLYING_MARKET_MAP.put(2,"场外");
+        APPLYING_MARKET_MAP.put(3,"场内和场外");
+
     }
 
     private final NavService navService;
@@ -624,4 +631,125 @@ public class FundInfoService {
         privatelyFundBaseInfoVO.setThirdStrategy(StrategyHandleUtils.getStrategyById(thirdStrategy).getStrategyNameDesc());
         return privatelyFundBaseInfoVO;
     }
+
+    public PubliclyFundBaseInfoVO getMfFundBaseInfo(String fundId) {
+        PubliclyFundBaseInfoVO publiclyFundBaseInfoVO = new PubliclyFundBaseInfoVO();
+        PubliclyFundBaseInfoDo fundInfo = this.baseInfoService.listPublicFundInfo(fundId);
+        if (fundInfo == null) {
+            return publiclyFundBaseInfoVO;
+        }
+        publiclyFundBaseInfoVO = BeanUtil.copyProperties(fundInfo, PubliclyFundBaseInfoVO.class);
+        publiclyFundBaseInfoVO.setBaseCurrency(fundInfo.getBaseCurrency() != null ? BASE_CURRENCY_MAP.get(Integer.valueOf(fundInfo.getBaseCurrency())) : null);
+        publiclyFundBaseInfoVO.setFundStatus(fundInfo.getFundStatusId() != null ? FUND_STATUS_MAP.get(Integer.valueOf(fundInfo.getFundStatusId())) : null);
+        //获取基金的基金经理
+        List<FundManagerInfoDo> fundManagerInfoList = this.baseInfoService.listFundManagerByFundId(fundId);
+        if (CollUtil.isNotEmpty(fundManagerInfoList)) {
+            List<ValueLabelVO> managerIdNameList = fundManagerInfoList.stream().map(e -> {
+                ValueLabelVO valueLabelVO = new ValueLabelVO();
+                valueLabelVO.setValue(e.getManagerId());
+                valueLabelVO.setLabel(e.getManagerName());
+                return valueLabelVO;
+            }).collect(Collectors.toList());
+            publiclyFundBaseInfoVO.setManagers(managerIdNameList);
+        }
+        //处理基金策略
+        Integer strategy = fundInfo.getStrategy();
+        Integer subStrategy = fundInfo.getSubstrategy();
+        publiclyFundBaseInfoVO.setStrategy(StrategyHandleUtils.getStrategyById(strategy).getStrategyNameDesc());
+        publiclyFundBaseInfoVO.setSubstrategy(StrategyHandleUtils.getStrategyById(subStrategy).getStrategyNameDesc());
+        //基金管理人,基金托管人
+        List<String> companyIdList = CollUtil.newArrayList();
+        List<CompanyInformationDo> companyInformationDos;
+        String trustId = fundInfo.getTrustId();
+        if (StrUtil.isNotBlank(trustId)) {
+            companyIdList.add(trustId);
+        }
+        String custodianId = fundInfo.getCustodianId();
+        if (StrUtil.isNotBlank(custodianId)) {
+            companyIdList.add(custodianId);
+        }
+        if (CollUtil.isNotEmpty(companyIdList)) {
+            companyInformationDos = companyInformationDao.listCompany(companyIdList);
+            if (CollUtil.isNotEmpty(companyInformationDos)) {
+                Map<String, CompanyInformationDo> companyInfoMap = companyInformationDos.stream().collect(Collectors.toMap(k -> k.getCompanyId(), v -> v));
+                publiclyFundBaseInfoVO.setTrustName(companyInfoMap.get(trustId) != null ? companyInfoMap.get(trustId).getCompanyShortName() : null);
+                publiclyFundBaseInfoVO.setCustodianName(companyInfoMap.get(custodianId) != null ? companyInfoMap.get(custodianId).getCompanyName() : null);
+            }
+        }
+        //开放日和申赎状态
+        handleOpenDayAndRedeemType(publiclyFundBaseInfoVO,fundId);
+        handleFundArchivesInfo(publiclyFundBaseInfoVO,fundId);
+        //初始规模和最新规模
+        handleFundScale(publiclyFundBaseInfoVO,fundId);
+        return publiclyFundBaseInfoVO;
+    }
+
+    private void handleOpenDayAndRedeemType(PubliclyFundBaseInfoVO publiclyFundBaseInfoVO, String fundId) {
+        List<ManualFundPurchaseRedeemDO> tempList = this.baseInfoService.getMFundPurchaseRedeemList(fundId);
+        if (CollUtil.isNotEmpty(tempList)) {
+            String type = null;
+            String applyingType = tempList.get(0).getApplyingType();
+            if (CharSequenceUtil.isNotBlank(applyingType)) {
+                // 限大额 -> 限大额申购
+                if ("限大额".equals(applyingType)) {
+                    applyingType = applyingType + "申购";
+                }
+                type = applyingType;
+            }
+            String redeemType = tempList.get(0).getRedeemType();
+            if (CharSequenceUtil.isNotBlank(redeemType)) {
+                type = type + "," + redeemType;
+            }
+            publiclyFundBaseInfoVO.setApplyRedemType(type);
+            publiclyFundBaseInfoVO.setOpenDays(this.findAndBuildOpenDay(tempList));
+        }
+    }
+
+    private List<FundOpenDayVO> findAndBuildOpenDay(List<ManualFundPurchaseRedeemDO> dataList) {
+        dataList.sort(Comparator.comparing(ManualFundPurchaseRedeemDO::getEndDate).reversed());
+        FundOpenDayVO apply = this.buildOpenDay(dataList, "可申购");
+        FundOpenDayVO redeem = this.buildOpenDay(dataList, "可赎回");
+        return ListUtil.of(apply, redeem);
+    }
+
+    private FundOpenDayVO buildOpenDay(List<ManualFundPurchaseRedeemDO> dataList, String type) {
+        Map<String, String> typeMapper = MapUtil.builder("可申购", "applyingType").put("可赎回", "redeemType").build();
+        ManualFundPurchaseRedeemDO purchaseRedeemDO = dataList.get(dataList.size() - 1);
+        String startDate = null;
+        for (ManualFundPurchaseRedeemDO data : dataList) {
+            // 小于结束日期的第一个不满足type约束的日期为开始日期
+            Object typeValue = ReflectUtil.getFieldValue(data, typeMapper.get(type));
+            if (typeValue != null && !Objects.equals(type, typeValue)) {
+                break;
+            }
+            startDate = data.getEndDate();
+        }
+        // 开始日为最后一天且value不为可申赎时置为null
+        Object fieldValue = ReflectUtil.getFieldValue(purchaseRedeemDO, typeMapper.get(type));
+        if (purchaseRedeemDO.getEndDate().equals(startDate) && !Objects.equals(type, fieldValue)) {
+            startDate = null;
+        }
+        return FundOpenDayVO.builder().type(type).startDate(startDate).build();
+    }
+
+    private void handleFundScale(PubliclyFundBaseInfoVO publiclyFundBaseInfoVO, String fundId) {
+        List<FundInitLatestAssetSizeDO> initLatest = this.baseInfoService.getFundInitLatestAssetSize(fundId);
+        if (CollUtil.isNotEmpty(initLatest)) {
+            NewDateValue initScale = initLatest.stream().filter(e -> "0".equals(e.getType())).map(e -> new NewDateValue(e.getDate(), e.getAssetSize())).findFirst().orElse(null);
+            NewDateValue latestScale = initLatest.stream().filter(e -> "1".equals(e.getType())).map(e -> new NewDateValue(e.getDate(), e.getAssetSize())).findFirst().orElse(null);
+            publiclyFundBaseInfoVO.setInitScale(initScale);
+            publiclyFundBaseInfoVO.setLatestScale(latestScale);
+        }
+    }
+
+    private void handleFundArchivesInfo(PubliclyFundBaseInfoVO publiclyFundBaseInfoVO, String fundId) {
+        FundArchivesInfoDO fundArchivesInfoDO = this.baseInfoService.queryFundArchives(fundId);
+        publiclyFundBaseInfoVO.setApplyingMarket(fundArchivesInfoDO.getApplyingMarket() != null
+                ? APPLYING_MARKET_MAP.get(Integer.valueOf(fundArchivesInfoDO.getApplyingMarket())) : APPLYING_MARKET_MAP.get(2));
+        publiclyFundBaseInfoVO.setLowestApplyAmount(fundArchivesInfoDO.getLowestApplyAmount());
+        publiclyFundBaseInfoVO.setLowestSumRedemption(fundArchivesInfoDO.getLowestSumRedemption());
+        NewDateValue initShare = new NewDateValue(fundArchivesInfoDO.getInitialDate(), fundArchivesInfoDO.getInitialShare());
+        publiclyFundBaseInfoVO.setInitShare(initShare);
+    }
+
 }

+ 13 - 3
src/main/java/com/smppw/analysis/client/FundApi.java

@@ -123,7 +123,7 @@ public class FundApi {
     /**
      * 私募基金详情页-基金经理
      *
-     * @param secId 基金id
+     * @param secId  基金id
      * @param appKey 访问授权码,用于接口验签
      * @return 基金经理信息
      */
@@ -157,7 +157,7 @@ public class FundApi {
     /**
      * 私募基金的基本信息
      *
-     * @param secId 基金id
+     * @param secId  基金id
      * @param appKey 访问授权码,用于接口验签
      * @return 私募基金基本信息
      */
@@ -166,5 +166,15 @@ public class FundApi {
         return ResultVo.ok(this.service.getFundBaseInfo(secId));
     }
 
-
+    /**
+     * 公募基金的基本信息
+     *
+     * @param secId  基金id
+     * @param appKey 访问授权码,用于接口验签
+     * @return 私募基金基本信息
+     */
+    @GetMapping("mf-base-info")
+    public ResultVo<PubliclyFundBaseInfoVO> getMfFundBaseInfo(@RequestParam("secId") String secId, String appKey) {
+        return ResultVo.ok(this.service.getMfFundBaseInfo(secId));
+    }
 }

+ 8 - 0
src/main/java/com/smppw/analysis/domain/dao/FundInformationDao.java

@@ -128,4 +128,12 @@ public class FundInformationDao {
     public List<FundManagerInfoDo> listFundManagerByFundId(String fundId){
         return this.fundInformationMapper.listFundManagerByFundId(fundId);
     }
+
+    public PubliclyFundBaseInfoDo listPubliclyFundInfo(String fundId){
+        return this.fundInformationMapper.listPublicFundInfo(fundId);
+    }
+
+    public List<ManualFundPurchaseRedeemDO> getMFundPurchaseRedeemList(String fundId) {
+      return  this.fundInformationMapper.listMFundPurchaseRedeemList(fundId);
+    }
 }

+ 28 - 0
src/main/java/com/smppw/analysis/domain/dataobject/FundInitLatestAssetSizeDO.java

@@ -0,0 +1,28 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/18 15:00
+ * @description
+ */
+@Data
+public class FundInitLatestAssetSizeDO {
+
+    /**
+     * 日期
+     */
+    private String date;
+
+    /**
+     * 资产
+     */
+    private String assetSize;
+
+    /**
+     * 类型
+     */
+    private String type;
+
+}

+ 33 - 0
src/main/java/com/smppw/analysis/domain/dataobject/ManualFundPurchaseRedeemDO.java

@@ -0,0 +1,33 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+
+/**
+ * @author wangzaijun
+ * @date 2023/5/24 16:03
+ * @description 公募基金的经理在管的所有基金的某个日期的资产值
+ */
+@Data
+public class ManualFundPurchaseRedeemDO {
+
+    /**
+     * 基金id
+     */
+    private String fundId;
+
+    /**
+     * 结束日期
+     */
+    private String endDate;
+
+    /**
+     * 机构场外代销申购状态
+     */
+    private String applyingType;
+
+    /**
+     * 机构场外代销赎回状态
+     */
+    private String redeemType;
+}

+ 38 - 0
src/main/java/com/smppw/analysis/domain/dataobject/MfFundArchivesInfoDo.java

@@ -0,0 +1,38 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/18 14:00
+ * @description 私募基金基本信息
+ */
+@Data
+public class MfFundArchivesInfoDo {
+
+    /**
+     * 交易场所
+     */
+    private Integer applyingMarket;
+
+    /**
+     * 初始份额
+     */
+    private String initialShare;
+
+    /**
+     * 初始份额日期
+     */
+    private String initialDate;
+
+    /**
+     * 最低申购金额,文字+数值+日期展示
+     */
+    private String lowestApplyAmount;
+
+    /**
+     * 最低赎回份额,文字+数值+日期展示
+     */
+    private String lowestSumRedemption;
+
+}

+ 3 - 0
src/main/java/com/smppw/analysis/domain/dataobject/PrivatelyFundBaseInfoDo.java

@@ -9,6 +9,7 @@ import lombok.Data;
  */
 @Data
 public class PrivatelyFundBaseInfoDo {
+
     /**
      * 基金id
      */
@@ -104,6 +105,8 @@ public class PrivatelyFundBaseInfoDo {
      */
     private String advisorId;
 
+    private String brokerId;
+
     /**
      * 托管银行
      */

+ 69 - 0
src/main/java/com/smppw/analysis/domain/dataobject/PubliclyFundBaseInfoDo.java

@@ -0,0 +1,69 @@
+package com.smppw.analysis.domain.dataobject;
+
+import lombok.Data;
+
+
+/**
+ * @author mozuwen
+ * @date 2023/8/18 14:00
+ * @description 私募基金基本信息
+ */
+@Data
+public class PubliclyFundBaseInfoDo {
+
+    /**
+     * 基金id
+     */
+    private String fundId;
+
+    /**
+     * 基金中文全称
+     */
+    private String fundName;
+
+    /**
+     * 基金中文简称
+     */
+    private String fundShortName;
+
+    /**
+     * 基金代码
+     */
+    private String registerNumber;
+
+    /**
+     * 策略
+     */
+    private Integer strategy;
+
+    /**
+     * 二级策略
+     */
+    private Integer substrategy;
+
+    /**
+     * 业绩基准
+     */
+    private String benchmarkName;
+
+    /**
+     * 基金货币
+     */
+    private String baseCurrency;
+
+    /**
+     * 基金管理人id
+     */
+    private String trustId;
+
+    /**
+     * 运行状态Id
+     */
+    private Integer fundStatusId;
+
+    /**
+     * 基金托管人id
+     */
+    private String custodianId;
+
+}

+ 31 - 0
src/main/java/com/smppw/analysis/domain/dto/info/FundOpenDayVO.java

@@ -0,0 +1,31 @@
+package com.smppw.analysis.domain.dto.info;
+
+import lombok.Builder;
+import lombok.Getter;
+import lombok.Setter;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/18 15:00
+ * @description 开放日字段处理
+ */
+@Getter
+@Setter
+@Builder
+public class FundOpenDayVO {
+
+    /**
+     * 类型
+     */
+    private String type;
+
+    /**
+     * 开始日期
+     */
+    private String startDate;
+
+    /**
+     * 结束日期
+     */
+    private String endDate;
+}

+ 135 - 0
src/main/java/com/smppw/analysis/domain/dto/info/PubliclyFundBaseInfoVO.java

@@ -0,0 +1,135 @@
+package com.smppw.analysis.domain.dto.info;
+
+import com.smppw.common.pojo.ValueLabelVO;
+import com.smppw.common.pojo.dto.NewDateValue;
+import lombok.Data;
+
+import java.util.List;
+
+/**
+ * @author mozuwen
+ * @date 2023/8/18 11:00
+ * @description 公募基金基本信息
+ */
+@Data
+public class PubliclyFundBaseInfoVO {
+
+    /**
+     * 基金id
+     */
+    private String fundId;
+
+    /**
+     * 基金中文全称
+     */
+    private String fundName;
+
+    /**
+     * 基金中文简称
+     */
+    private String fundShortName;
+
+    /**
+     * 基金代码
+     */
+    private String registerNumber;
+
+    /**
+     * 策略
+     */
+    private String strategy;
+
+    /**
+     * 二级策略
+     */
+    private String substrategy;
+
+    /**
+     * 业绩基准
+     */
+    private String benchmarkName;
+
+    /**
+     * 交易场所,申购赎回场所,为空则为场外
+     */
+    private String applyingMarket;
+
+    /**
+     * 基金货币
+     */
+    private String baseCurrency;
+
+    /**
+     * 投资经理,value-投资经理id,label-投资经理名称
+     */
+    private List<ValueLabelVO> managers;
+
+    /**
+     * 基金管理人id
+     */
+    private String trustId;
+
+    /**
+     * 基金管理人名称
+     */
+    private String trustName;
+
+    /**
+     * 运行状态id
+     */
+    private String fundStatusId;
+
+    /**
+     * 运行状态名称
+     */
+    private String fundStatus;
+
+    /**
+     * 申赎状态,申购状态:1-开放申购 2-暂停申购 3-限大额 4-认购期 5-封闭期 6-场内交易 赎回状态:1-开放申购 2-暂停申购 3-认购期 4-封闭期 5-场内交易
+     */
+    private String applyRedemType;
+
+    /**
+     * 开放日
+     * eg:
+     * 申购起止:yyyy-mm-dd~yyyy-mm-dd
+     * 赎回起止:yyyy-mm-dd~yyyy-mm-dd
+     */
+    private List<FundOpenDayVO> openDays;
+
+    /**
+     * 最低申购金额,文字+数值+日期展示
+     */
+    private String lowestApplyAmount;
+
+    /**
+     * 最低赎回份额,文字+数值+日期展示
+     */
+    private String lowestSumRedemption;
+
+    /**
+     * 初始资产规模
+     */
+    private NewDateValue initScale;
+
+    /**
+     * 最新资产规模
+     */
+    private NewDateValue latestScale;
+
+    /**
+     * 初始份额
+     */
+    private NewDateValue initShare;
+
+    /**
+     * 基金托管人id
+     */
+    private String custodianId;
+
+    /**
+     * 基金托管人名称
+     */
+    private String custodianName;
+
+}

+ 9 - 0
src/main/java/com/smppw/analysis/domain/mapper/core/FundAssetSizeMapper.java

@@ -1,5 +1,6 @@
 package com.smppw.analysis.domain.mapper.core;
 
+import com.smppw.analysis.domain.dataobject.FundInitLatestAssetSizeDO;
 import com.smppw.analysis.domain.dataobject.ManualFundAssetSizeDo;
 import org.springframework.stereotype.Repository;
 
@@ -13,6 +14,7 @@ import java.util.List;
  */
 @Repository
 public interface FundAssetSizeMapper {
+
     /**
      * 获取基金最新的管理规模
      *
@@ -28,4 +30,11 @@ public interface FundAssetSizeMapper {
      */
     List<ManualFundAssetSizeDo> getAssetSizeList(String managerId);
 
+    /**
+     * 获取公募基金的资产初始规模和最新规模
+     *
+     * @param fundId 基金id
+     * @return 公募基金的资产初始规模和最新规模
+     */
+    List<FundInitLatestAssetSizeDO> getFundInitLatestAssetSize(String fundId);
 }

+ 15 - 0
src/main/java/com/smppw/analysis/domain/mapper/core/FundInformationMapper.java

@@ -94,4 +94,19 @@ public interface FundInformationMapper {
      */
     List<FundManagerInfoDo> listFundManagerByFundId(@Param("fundId") String fundId);
 
+    /**
+     * 获取公募基金的基本信息
+     *
+     * @param fundId 基金id
+     * @return 私募基金的基本信息
+     */
+    PubliclyFundBaseInfoDo listPublicFundInfo(@Param("fundId") String fundId);
+
+    /**
+     * 公募基金的申赎状态
+     *
+     * @param fundId 基金id
+     * @return /
+     */
+    List<ManualFundPurchaseRedeemDO> listMFundPurchaseRedeemList(String fundId);
 }

+ 24 - 0
src/main/java/com/smppw/analysis/domain/service/BaseInfoService.java

@@ -203,4 +203,28 @@ public interface BaseInfoService {
      * @return 基金的基金经理
      */
     List<FundManagerInfoDo> listFundManagerByFundId(String fundId);
+
+    /**
+     * 获取公募基金的基本信息
+     *
+     * @param fundId 基金id
+     * @return 私募基金的基本信息
+     */
+    PubliclyFundBaseInfoDo listPublicFundInfo(String fundId);
+
+    /**
+     * 获取公募基金的资产初始规模和最新规模
+     *
+     * @param fundId 基金id
+     * @return 公募基金的资产初始规模和最新规模
+     */
+    List<FundInitLatestAssetSizeDO> getFundInitLatestAssetSize(String fundId);
+
+    /**
+     * 公募基金的申赎状态
+     *
+     * @param fundId 基金id
+     * @return /
+     */
+    List<ManualFundPurchaseRedeemDO> getMFundPurchaseRedeemList(String fundId);
 }

+ 15 - 0
src/main/java/com/smppw/analysis/domain/service/impl/BaseInfoServiceImpl.java

@@ -359,6 +359,21 @@ public class BaseInfoServiceImpl implements BaseInfoService, ApplicationContextA
         return fundInformationDao.listFundManagerByFundId(fundId);
     }
 
+    @Override
+    public PubliclyFundBaseInfoDo listPublicFundInfo(String fundId) {
+        return fundInformationDao.listPubliclyFundInfo(fundId);
+    }
+
+    @Override
+    public List<FundInitLatestAssetSizeDO> getFundInitLatestAssetSize(String fundId) {
+        return fundAssetSizeMapper.getFundInitLatestAssetSize(fundId);
+    }
+
+    @Override
+    public List<ManualFundPurchaseRedeemDO> getMFundPurchaseRedeemList(String fundId) {
+        return fundInformationDao.getMFundPurchaseRedeemList(fundId);
+    }
+
     /**
      * 把指定类型的标的的名称映射查询出来
      *

+ 16 - 0
src/main/resources/mapping/core/FundAssetSizeMapper.xml

@@ -22,4 +22,20 @@
         where a.fund_id = #{fundId}
         order by a.fund_asset_size_date desc limit 1
     </select>
+
+    <select id="getFundInitLatestAssetSize"
+            resultType="com.smppw.analysis.domain.dataobject.FundInitLatestAssetSizeDO">
+        select t.fund_asset_size_date as `date`,
+               t.fund_asset_size as assetSize,
+               IF(t.fund_asset_size_date = t1.mind, 0, 1) as `type`
+        from rz_hfdb_core.fund_asset_size t
+                 join (
+            select a.fund_id, max(a.fund_asset_size_date) maxd, min(a.fund_asset_size_date) mind
+            from rz_hfdb_core.fund_asset_size a
+            where a.fund_id = #{fundId}
+              and a.isvalid = 1
+        ) t1 on t.fund_id = t1.fund_id
+        where t.fund_asset_size_date in (t1.maxd, t1.mind)
+    </select>
+
 </mapper>

+ 30 - 0
src/main/resources/mapping/core/FundInformationMapper.xml

@@ -439,4 +439,34 @@
           and t1.fund_id = #{fundId}
     </select>
 
+    <select id="listPublicFundInfo" resultType="com.smppw.analysis.domain.dataobject.PubliclyFundBaseInfoDo">
+        SELECT t1.`fund_id`             AS fundId,
+               t1.`fund_name`           AS fundName,
+               t1.`fund_short_name`     AS fundShortName,
+               t1.register_number       AS registerNumber,
+               t2.`strategy`            AS strategy,
+               t2.`substrategy`         AS substrategy,
+               t1.`secondary_benchmark` AS benchmarkName,
+               t1.`base_currency`       AS baseCurrency,
+               t1.trust_id              AS trustId,
+               t3.fund_status           AS fundStatusId,
+               t1.custodian_id          AS custodianId
+        FROM `rz_hfdb_core`.fund_information t1
+                 JOIN `rz_hfdb_core`.`fund_strategy` t2 ON t1.`fund_id` = t2.`fund_id` AND t2.isvalid = 1
+                 JOIN rz_hfdb_core.fund_status t3 ON t1.fund_id = t3.fund_id AND t3.isvalid = 1
+        WHERE t1.fund_id = #{fundId}
+          AND t1.isvalid = 1
+    </select>
+
+    <select id="listMFundPurchaseRedeemList"
+            resultType="com.smppw.analysis.domain.dataobject.ManualFundPurchaseRedeemDO">
+        select a.fund_id            as fundId,
+               a.end_date           as endDate,
+               a.applying_type_viii as applyingType,
+               a.redeem_type_viii   as redeemType
+        from rz_hfdb_core.mf_purchase_and_redeem a
+        where a.fund_id = #{fundId}
+        order by a.end_date desc
+    </select>
+
 </mapper>