|
@@ -0,0 +1,352 @@
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
|
|
+<mapper namespace="com.smppw.analysis.infrastructure.persistence.FundInformationDoMapper">
|
|
|
+ <resultMap id="BaseResultMap" type="com.smppw.analysis.domain.entity.FundInformationDo">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ <!--@Table fund_information-->
|
|
|
+ <id column="id" property="id"/>
|
|
|
+ <result column="p_fund_id" property="pFundId"/>
|
|
|
+ <result column="fund_id" property="fundId"/>
|
|
|
+ <result column="fund_name" property="fundName"/>
|
|
|
+ <result column="fund_short_name" property="fundShortName"/>
|
|
|
+ <result column="fund_structure" property="fundStructure"/>
|
|
|
+ <result column="fund_type" property="fundType"/>
|
|
|
+ <result column="public_fund_type" property="publicFundType"/>
|
|
|
+ <result column="pub_fund_type" property="pubFundType"/>
|
|
|
+ <result column="pub_sub_fund_type" property="pubSubFundType"/>
|
|
|
+ <result column="fund_characteristic" property="fundCharacteristic"/>
|
|
|
+ <result column="base_currency" property="baseCurrency"/>
|
|
|
+ <result column="inception_date" property="inceptionDate"/>
|
|
|
+ <result column="domicile" property="domicile"/>
|
|
|
+ <result column="primary_benchmark_id" property="primaryBenchmarkId"/>
|
|
|
+ <result column="secondary_benchmark" property="secondaryBenchmark"/>
|
|
|
+ <result column="lockup_period" property="lockupPeriod"/>
|
|
|
+ <result column="lockup_period_unit" property="lockupPeriodUnit"/>
|
|
|
+ <result column="lockup_period2" property="lockupPeriod2"/>
|
|
|
+ <result column="lock_period" property="lockPeriod"/>
|
|
|
+ <result column="lock_period_unit" property="lockPeriodUnit"/>
|
|
|
+ <result column="open_day" property="openDay"/>
|
|
|
+ <result column="redemption_day" property="redemptionDay"/>
|
|
|
+ <result column="duration" property="duration"/>
|
|
|
+ <result column="initial_unit_value" property="initialUnitValue"/>
|
|
|
+ <result column="investment_scope" property="investmentScope"/>
|
|
|
+ <result column="investment_objective" property="investmentObjective"/>
|
|
|
+ <result column="fund_portfolio" property="fundPortfolio"/>
|
|
|
+ <result column="investment_restriction" property="investmentRestriction"/>
|
|
|
+ <result column="fund_investment_philosophy" property="fundInvestmentPhilosophy"/>
|
|
|
+ <result column="fund_strategy_description" property="fundStrategyDescription"/>
|
|
|
+ <result column="investment_process" property="investmentProcess"/>
|
|
|
+ <result column="advisor_id" property="advisorId"/>
|
|
|
+ <result column="custodian_id" property="custodianId"/>
|
|
|
+ <result column="broker_id" property="brokerId"/>
|
|
|
+ <result column="broker_future_id" property="brokerFutureId"/>
|
|
|
+ <result column="liquidation_agency_id" property="liquidationAgencyId"/>
|
|
|
+ <result column="trust_id" property="trustId"/>
|
|
|
+ <result column="administrator_id" property="administratorId"/>
|
|
|
+ <result column="legal_counsel_id" property="legalCounselId"/>
|
|
|
+ <result column="auditor_id" property="auditorId"/>
|
|
|
+ <result column="general_service_id" property="generalServiceId"/>
|
|
|
+ <result column="issuer_id" property="issuerId"/>
|
|
|
+ <result column="nav_frequency" property="navFrequency"/>
|
|
|
+ <result column="performance_disclosure_mark" property="performanceDisclosureMark"/>
|
|
|
+ <result column="performance_disclosure_type" property="performanceDisclosureType"/>
|
|
|
+ <result column="IsVisible" property="isvisible"/>
|
|
|
+ <result column="manager_type" property="managerType"/>
|
|
|
+ <result column="begin_member_cnt" property="beginMemberCnt"/>
|
|
|
+ <result column="register_period" property="registerPeriod"/>
|
|
|
+ <result column="zjx_last_info_update_time" property="zjxLastInfoUpdateTime"/>
|
|
|
+ <result column="special_tips" property="specialTips"/>
|
|
|
+ <result column="amac_url" property="amacUrl"/>
|
|
|
+ <result column="raise_type" property="raiseType"/>
|
|
|
+ <result column="risk_return_desc" property="riskReturnDesc"/>
|
|
|
+ <result column="creatorid" property="creatorid"/>
|
|
|
+ <result column="createtime" property="createtime"/>
|
|
|
+ <result column="updaterid" property="updaterid"/>
|
|
|
+ <result column="updatetime" property="updatetime"/>
|
|
|
+ <result column="isvalid" property="isvalid"/>
|
|
|
+ <result column="register_number" property="registerNumber"/>
|
|
|
+ <result column="istiered" property="istiered"/>
|
|
|
+ <result column="istiered_desc" property="istieredDesc"/>
|
|
|
+ <result column="register_date" property="registerDate"/>
|
|
|
+ <result column="is_ranking" property="isRanking"/>
|
|
|
+ <result column="is_rating" property="isRating"/>
|
|
|
+ <result column="nav_source" property="navSource"/>
|
|
|
+ <result column="contract_name" property="contractName"/>
|
|
|
+ <result column="contract_path" property="contractPath"/>
|
|
|
+ <result column="is_authorized" property="isAuthorized"/>
|
|
|
+ <result column="is_in_research" property="isInResearch"/>
|
|
|
+ <result column="visible_ctrl" property="visibleCtrl"/>
|
|
|
+ <result column="is_nav_visible" property="isNavVisible"/>
|
|
|
+ <result column="is_nav_visible_org" property="isNavVisibleOrg"/>
|
|
|
+ <result column="is_fee_before" property="isFeeBefore"/>
|
|
|
+ <result column="is_deduct_reward" property="isDeductReward"/>
|
|
|
+ <result column="valuation_institution_id" property="valuationInstitutionId"/>
|
|
|
+ <result column="trust_register_number" property="trustRegisterNumber"/>
|
|
|
+ <result column="is_consignment" property="isConsignment"/>
|
|
|
+ <result column="is_qdii" property="isQdii"/>
|
|
|
+ <result column="is_exclusive" property="isExclusive"/>
|
|
|
+ <result column="is_show_independent" property="isShowIndependent"/>
|
|
|
+ <result column="trust_apply_register_date" property="trustApplyRegisterDate"/>
|
|
|
+ <result column="trust_publicity_date" property="trustPublicityDate"/>
|
|
|
+ <result column="trust_main_industry" property="trustMainIndustry"/>
|
|
|
+ <result column="trust_property_application" property="trustPropertyApplication"/>
|
|
|
+ <result column="trust_function" property="trustFunction"/>
|
|
|
+ <result column="is_amac_show" property="isAmacShow"/>
|
|
|
+ </resultMap>
|
|
|
+ <sql id="Base_Column_List">
|
|
|
+ <!--@mbg.generated-->
|
|
|
+ id,
|
|
|
+ p_fund_id,
|
|
|
+ fund_id,
|
|
|
+ fund_name,
|
|
|
+ fund_short_name,
|
|
|
+ fund_structure,
|
|
|
+ fund_type,
|
|
|
+ public_fund_type,
|
|
|
+ pub_fund_type,
|
|
|
+ pub_sub_fund_type,
|
|
|
+ fund_characteristic,
|
|
|
+ base_currency,
|
|
|
+ inception_date,
|
|
|
+ domicile,
|
|
|
+ primary_benchmark_id,
|
|
|
+ secondary_benchmark,
|
|
|
+ lockup_period,
|
|
|
+ lockup_period_unit,
|
|
|
+ lockup_period2,
|
|
|
+ lock_period,
|
|
|
+ lock_period_unit,
|
|
|
+ open_day,
|
|
|
+ redemption_day,
|
|
|
+ duration,
|
|
|
+ initial_unit_value,
|
|
|
+ investment_scope,
|
|
|
+ investment_objective,
|
|
|
+ fund_portfolio,
|
|
|
+ investment_restriction,
|
|
|
+ fund_investment_philosophy,
|
|
|
+ fund_strategy_description,
|
|
|
+ investment_process,
|
|
|
+ advisor_id,
|
|
|
+ custodian_id,
|
|
|
+ broker_id,
|
|
|
+ broker_future_id,
|
|
|
+ liquidation_agency_id,
|
|
|
+ trust_id,
|
|
|
+ administrator_id,
|
|
|
+ legal_counsel_id,
|
|
|
+ auditor_id,
|
|
|
+ general_service_id,
|
|
|
+ issuer_id,
|
|
|
+ nav_frequency,
|
|
|
+ performance_disclosure_mark,
|
|
|
+ performance_disclosure_type,
|
|
|
+ IsVisible,
|
|
|
+ manager_type,
|
|
|
+ begin_member_cnt,
|
|
|
+ register_period,
|
|
|
+ zjx_last_info_update_time,
|
|
|
+ special_tips,
|
|
|
+ amac_url,
|
|
|
+ raise_type,
|
|
|
+ risk_return_desc,
|
|
|
+ creatorid,
|
|
|
+ createtime,
|
|
|
+ updaterid,
|
|
|
+ updatetime,
|
|
|
+ isvalid,
|
|
|
+ register_number,
|
|
|
+ istiered,
|
|
|
+ istiered_desc,
|
|
|
+ register_date,
|
|
|
+ is_ranking,
|
|
|
+ is_rating,
|
|
|
+ nav_source,
|
|
|
+ contract_name,
|
|
|
+ contract_path,
|
|
|
+ is_authorized,
|
|
|
+ is_in_research,
|
|
|
+ visible_ctrl,
|
|
|
+ is_nav_visible,
|
|
|
+ is_nav_visible_org,
|
|
|
+ is_fee_before,
|
|
|
+ is_deduct_reward,
|
|
|
+ valuation_institution_id,
|
|
|
+ trust_register_number,
|
|
|
+ is_consignment,
|
|
|
+ is_qdii,
|
|
|
+ is_exclusive,
|
|
|
+ is_show_independent,
|
|
|
+ trust_apply_register_date,
|
|
|
+ trust_publicity_date,
|
|
|
+ trust_main_industry,
|
|
|
+ trust_property_application,
|
|
|
+ trust_function,
|
|
|
+ is_amac_show
|
|
|
+ </sql>
|
|
|
+
|
|
|
+ <select id="listFundIdByFundIdListAndVisibilityId" resultType="java.lang.String">
|
|
|
+ select distinct fund_id
|
|
|
+ from rz_hfdb_core.fund_information where is_nav_visible_org = #{visibilityId}
|
|
|
+ AND isvalid = 1
|
|
|
+ AND fund_id in
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listFundIdByFundIdsAndVisibilityIdForInvestAdvisor" resultType="java.lang.String">
|
|
|
+ select distinct fund_id
|
|
|
+ from rz_hfdb_core.fund_information
|
|
|
+ where isvisible = 1
|
|
|
+ and is_nav_visible = #{visibilityId}
|
|
|
+ AND isvalid = 1
|
|
|
+ AND fund_id in
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listFundInfo" resultMap="BaseResultMap">
|
|
|
+ select *
|
|
|
+ from rz_hfdb_core.fund_information where isvalid = 1
|
|
|
+ AND fund_id in
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFundFrequency" resultType="java.util.Map">
|
|
|
+ SELECT f.fund_id fundId, f.nav_frequency frequency, f.trust_id trustId
|
|
|
+ FROM rz_hfdb_core.fund_information f WHERE f.isvalid = 1
|
|
|
+ AND f.fund_id in
|
|
|
+ <foreach collection="fundIds" index="index" item="fundId" open="(" close=")" separator=",">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="getManagerFundFeature" resultType="java.util.Map">
|
|
|
+ SELECT ds.strategy_name, COUNT(t4.first_strategy) as countSum
|
|
|
+ FROM rz_hfdb_core.`fund_information` t1
|
|
|
+ INNER JOIN rz_hfdb_core.`fund_status` t2 ON (t1.fund_id = t2.fund_id)
|
|
|
+ INNER JOIN rz_hfdb_core.fund_manager_mapping t3 ON (t1.`fund_id` = t3.fund_id)
|
|
|
+ INNER JOIN rz_hfdb_core.`fund_strategy` t4 ON t4.`fund_id` = t1.`fund_id`
|
|
|
+ INNER JOIN rz_hfdb_core.dict_strategy ds on t4.first_strategy = ds.strategy_code and ds.isvalid = 1
|
|
|
+ WHERE (t1.fund_type NOT IN (5, -1, 9, 10, 11, 12, 13) OR t1.raise_type = 2)
|
|
|
+ AND t3.isvalid = 1
|
|
|
+ and t3.fund_manager_id = #{managerId}
|
|
|
+ AND t1.isvalid = 1
|
|
|
+ AND t3.isvisible = 1
|
|
|
+ group by t4.first_strategy
|
|
|
+ ORDER BY countSum desc
|
|
|
+ </select>
|
|
|
+ <select id="getFundByFundId" resultMap="BaseResultMap">
|
|
|
+ select *
|
|
|
+ from rz_hfdb_core.`fund_information`
|
|
|
+ where fund_id = #{fundId}
|
|
|
+ and isvalid = 1
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFundInfos" resultType="java.util.Map">
|
|
|
+ SELECT fi.fund_id,
|
|
|
+ fi.fund_name,
|
|
|
+ fi.fund_short_name,
|
|
|
+ date_format(fi.inception_date,'%Y-%m-%d') as inception_date,
|
|
|
+ fi.is_nav_visible AS is_nav_visible,
|
|
|
+ fi.isvisible AS is_visible,
|
|
|
+ fi.is_nav_visible_org AS is_nav_visible_org,
|
|
|
+ ci.company_id AS 'advisor_id',
|
|
|
+ ci.company_name AS 'advisor_name',
|
|
|
+ ci.company_short_name AS 'advisor_short_name',
|
|
|
+ mi.manager_name,
|
|
|
+ mi.manager_id
|
|
|
+ FROM rz_hfdb_core.fund_information fi
|
|
|
+ LEFT JOIN rz_hfdb_core.fund_manager_mapping fm ON fi.fund_id = fm.fund_id AND fm.isvalid = 1
|
|
|
+ LEFT JOIN rz_hfdb_core.company_information ci ON ci.company_id = fi.trust_id AND ci.isvalid = 1
|
|
|
+ LEFT JOIN rz_combination_master.cm_big_data_manager_info mi
|
|
|
+ ON fm.fund_manager_id = mi.manager_id WHERE fi.isvalid = 1
|
|
|
+ AND fi.fund_id in
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getFundRet" resultType="java.util.Map">
|
|
|
+ SELECT p.fund_id,
|
|
|
+ date_format(p.price_date,'%Y-%m-%d') as price_date,
|
|
|
+ p.ret_incep,
|
|
|
+ p.ret_incep_a,
|
|
|
+ n.nav,
|
|
|
+ p.cumulative_nav,
|
|
|
+ p.ret_ytd,
|
|
|
+ p.ret_ytd_a,
|
|
|
+ p.ret_1m,
|
|
|
+ p.ret_1m_a,
|
|
|
+ p.ret_3m,
|
|
|
+ p.ret_3m_a,
|
|
|
+ p.ret_6m,
|
|
|
+ p.ret_6m_a,
|
|
|
+ p.ret_1y,
|
|
|
+ p.ret_1y_a,
|
|
|
+ p.ret_3y,
|
|
|
+ p.ret_3y_a
|
|
|
+ FROM rz_hfdb_core.fund_latest_nav_performance p
|
|
|
+ LEFT JOIN rz_hfdb_core.nav n
|
|
|
+ ON p.fund_id = n.fund_id AND p.price_date = n.price_date WHERE p.isvalid = 1
|
|
|
+ AND p.fund_id IN
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="getMaxFundEndDate" resultType="java.lang.String">
|
|
|
+ SELECT max(price_date) AS 'end_date' FROM rz_hfdb_core.fund_latest_nav_performance p WHERE p.isvalid=1 AND p.fund_id IN
|
|
|
+ <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
|
|
|
+ #{fundId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listFundIdByCompanyId" resultType="java.lang.String">
|
|
|
+ select t1.fund_id
|
|
|
+ from fund_information t1
|
|
|
+ left join company_information t2 on t1.trust_id = t2.company_id
|
|
|
+ where t1.isvalid = 1
|
|
|
+ and t2.company_id = #{companyId} and t2.isvalid=1
|
|
|
+ order by t1.createtime
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="listCompanyIdByPersonnelId" resultType="java.lang.String">
|
|
|
+ SELECT DISTINCT t2.company_id
|
|
|
+ FROM rz_hfdb_core.personnel_company_position_mapping t1
|
|
|
+ LEFT JOIN rz_hfdb_core.company_information t2
|
|
|
+ ON t1.company_id = t2.company_id AND t2.isvalid = 1
|
|
|
+ LEFT JOIN rz_hfdb_core.personnel_company_position_id_mapping t3
|
|
|
+ ON t3.`isvalid`=1 AND t3.`rec_id`=t1.id
|
|
|
+ LEFT JOIN rz_hfdb_core.d_position t4
|
|
|
+ ON t3.position_id=t4.id AND t4.`isvalid`=1
|
|
|
+ WHERE t1.isvalid = 1
|
|
|
+ AND t4.position_name REGEXP '总经理|董事|CEO|CFO|COO|CIO|投资经理|合规负责人|合规风控|监事|总监|法定代表人|法人|合伙人|创始人|总裁|主管|法人代表|基金经理'
|
|
|
+ and t1.personnel_id in
|
|
|
+ <foreach collection="personnelIdList" item="personnelId" index="index" open="(" separator="," close=")">
|
|
|
+ #{personnelId}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+ <select id="listFundInfoByCompanyId" resultType="java.util.Map" parameterType="java.lang.String">
|
|
|
+ select t1.fund_id as fundId,t1.fund_short_name as fundShortName,
|
|
|
+ t1.register_number as registerNumber
|
|
|
+ from fund_information t1
|
|
|
+ left join company_information t2 on t1.trust_id = t2.company_id
|
|
|
+ where t1.isvalid = 1
|
|
|
+ and t2.company_id = #{companyId} and t2.isvalid=1
|
|
|
+ order by t1.createtime
|
|
|
+
|
|
|
+ </select>
|
|
|
+ <select id="listFundRegisterNumber" resultType="java.util.Map">
|
|
|
+ select fund_id as fundId,register_number as registerNumber
|
|
|
+ from fund_information
|
|
|
+ where isvalid = 1 and fund_id in
|
|
|
+ <foreach collection="fundIdList" item="item" index="index" separator="," open="(" close=")">
|
|
|
+ #{item}
|
|
|
+ </foreach>
|
|
|
+ </select>
|
|
|
+
|
|
|
+</mapper>
|