FundInfoMapper.xml 8.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <mapper namespace="com.simuwang.base.mapper.FundInfoMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.FundInfoDO">
  5. <id column="id" property="id"/>
  6. <result column="p_fund_id" property="pFundId"/>
  7. <result column="fund_name" property="fundName"/>
  8. <result column="fund_short_name" property="fundShortName"/>
  9. <result column="fund_type" property="fundType"/>
  10. <result column="manager_type" property="managerType"/>
  11. <result column="base_currency" property="baseCurrency"/>
  12. <result column="inception_date" property="inceptionDate"/>
  13. <result column="advisor_id" property="advisorId"/>
  14. <result column="issuer_id" property="issuerId"/>
  15. <result column="custodian_id" property="custodianId"/>
  16. <result column="register_number" property="registerNumber"/>
  17. <result column="register_date" property="registerDate"/>
  18. <result column="is_amac_show" property="isAmacShow"/>
  19. <result column="fund_status" property="fundStatus"/>
  20. <result column="amac_source_type" property="amacSourceType"/>
  21. <result column="investment_type" property="investmentType"/>
  22. <result column="liquidate_date" property="liquidateDate"/>
  23. <result column="performance_start_date" property="performanceStartDate"/>
  24. <result column="is_shareclass" property="isShareclass"/>
  25. <result column="trust_id" property="trustId"/>
  26. <result column="createtime" property="createTime"/>
  27. <result column="updatetime" property="updateTime"/>
  28. <result column="isvalid" property="isvalid"/>
  29. </resultMap>
  30. <select id="searchFundInfoByKeyword" resultType="java.util.Map">
  31. select f.fund_id as "fundId",
  32. f.fund_short_name as "fundShortName",
  33. f.register_number as "registerNumber"
  34. from PPW_EMAIL.pvn_fund_info f where f.isvalid =1
  35. <if test="keyword != null and keyword !=''">
  36. 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},'%'))
  37. </if>
  38. limit #{offset},#{pageSize}
  39. </select>
  40. <select id="searchFundInfoList" resultType="com.simuwang.base.pojo.vo.FundInformationVO">
  41. select f.fund_id as fundId,
  42. f.fund_short_name as fundShortName,
  43. c.company_short_name as companyShortName,
  44. f.inception_date as inceptionDate,
  45. n.last_price_date as lastPriceDate,
  46. r.nav_frequency as navFrequency,
  47. r.asset_Frequency as assetFrequency,
  48. r.frequency_remark as frequencyRemark
  49. from PPW_EMAIL.pvn_fund_info f
  50. join PPW_EMAIL.pvn_company_info c on f.trust_id = c.company_id
  51. 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
  52. on f.fund_id = n .fund_id
  53. left join PPW_EMAIL.fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
  54. where f.isvalid =1 and c.isvalid =1
  55. <if test="fundId != null and fundId !=''">
  56. and f.fund_id like concat('%',#{fundId},'%')
  57. </if>
  58. <if test="fundShortName != null and fundShortName !=''">
  59. and (f.fund_name like concat('%',#{fundShortName},'%') or f.fund_short_name like concat('%',#{fundShortName},'%') or f.register_number like concat('%',#{fundShortName},'%'))
  60. </if>
  61. <if test="companyShortName != null and companyShortName !=''">
  62. and (c.company_name like concat('%',#{companyShortName},'%') or c.company_short_name like concat('%',#{companyShortName},'%') or c.register_number like concat('%',#{companyShortName},'%'))
  63. </if>
  64. <if test="navFrequency != null and navFrequency !=''">
  65. and r.nav_frequency = #{navFrequency}
  66. </if>
  67. <if test="assetFrequency != null and assetFrequency !=''">
  68. and r.asset_Frequency = #{assetFrequency}
  69. </if>
  70. <if test="startDate != null and startDate !=''">
  71. and f.inception_date <![CDATA[ >= ]]> #{startDate}
  72. </if>
  73. <if test="endDate != null and endDate !=''">
  74. and f.inception_date <![CDATA[ <= ]]> #{endDate}
  75. </if>
  76. limit #{offset},#{pageSize}
  77. </select>
  78. <select id="queryFundByNameAndRegisterNumber" resultType="com.simuwang.base.pojo.dos.FundInfoDO">
  79. select fund_id as fundId,
  80. fund_name as fundName,
  81. register_number as registerNumber
  82. from PPW_EMAIL.pvn_fund_info
  83. where isvalid = 1
  84. and fund_name = #{fundName}
  85. and register_number = #{registerNumber}
  86. </select>
  87. <select id="queryFundByName" resultType="com.simuwang.base.pojo.dos.FundInfoDO">
  88. select fund_id as fundId,
  89. fund_name as fundName,
  90. register_number as registerNumber
  91. from PPW_EMAIL.pvn_fund_info
  92. where isvalid = 1
  93. and fund_name = #{fundName}
  94. </select>
  95. <select id="queryFundByRegisterNumber" resultType="com.simuwang.base.pojo.dos.FundInfoDO">
  96. select fund_id as fundId,
  97. fund_name as fundName,
  98. register_number as registerNumber
  99. from PPW_EMAIL.pvn_fund_info
  100. where isvalid = 1
  101. and register_number = #{registerNumber}
  102. </select>
  103. <select id="countFundInfoByKeyword" resultType="java.lang.Long"
  104. parameterType="com.simuwang.base.pojo.dto.query.FundInputPageQuery">
  105. select count(f.fund_id)
  106. from PPW_EMAIL.pvn_fund_info f where f.isvalid =1
  107. <if test="keyword != null and keyword !=''">
  108. 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},'%'))
  109. </if>
  110. </select>
  111. <select id="countFundInfo" resultType="java.lang.Long"
  112. parameterType="com.simuwang.base.pojo.dto.query.FundInfoPageQuery">
  113. select count(f.fund_id)
  114. from PPW_EMAIL.pvn_fund_info f
  115. join PPW_EMAIL.pvn_company_info c on f.trust_id = c.company_id
  116. 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
  117. on f.fund_id = n .fund_id
  118. left join PPW_EMAIL.fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
  119. where f.isvalid =1 and c.isvalid =1
  120. <if test="fundId != null and fundId !=''">
  121. and f.fund_id like concat('%',#{fundId},'%')
  122. </if>
  123. <if test="fundShortName != null and fundShortName !=''">
  124. and (f.fund_name like concat('%',#{fundShortName},'%') or f.fund_short_name like concat('%',#{fundShortName},'%') or f.register_number like concat('%',#{fundShortName},'%'))
  125. </if>
  126. <if test="companyShortName != null and companyShortName !=''">
  127. and (c.company_name like concat('%',#{companyShortName},'%') or c.company_short_name like concat('%',#{companyShortName},'%') or c.register_number like concat('%',#{companyShortName},'%'))
  128. </if>
  129. <if test="navFrequency != null and navFrequency !=''">
  130. and r.nav_frequency = #{navFrequency}
  131. </if>
  132. <if test="assetFrequency != null and assetFrequency !=''">
  133. and r.asset_Frequency = #{assetFrequency}
  134. </if>
  135. <if test="startDate != null and startDate !=''">
  136. and f.inception_date <![CDATA[ >= ]]> #{startDate}
  137. </if>
  138. <if test="endDate != null and endDate !=''">
  139. and f.inception_date <![CDATA[ <= ]]> #{endDate}
  140. </if>
  141. </select>
  142. <select id="getFundNameByFundId" resultType="java.lang.String" parameterType="java.lang.String">
  143. select fund_name from PPW_EMAIL.pvn_fund_info where fund_id=#{fundId} and isvalid=1
  144. </select>
  145. <select id="queryFundIdByName" resultType="java.lang.String" parameterType="java.lang.String">
  146. select fund_id
  147. from PPW_EMAIL.pvn_fund_info
  148. where isvalid = 1
  149. and fund_name = #{fundName} limit 1
  150. </select>
  151. <select id="getCompanyNameByFundId" resultType="java.lang.String" parameterType="java.lang.String">
  152. select c.company_name from PPW_EMAIL.pvn_company_info c
  153. join PPW_EMAIL.pvn_fund_info info on info.trust_id=c.company_id
  154. where info.fund_id=#{fundId} and info.isvalid=1 and c.isvalid=1
  155. </select>
  156. <select id="getInceptionDateByFundId" resultType="java.lang.String" parameterType="java.lang.String">
  157. select inception_date from PPW_EMAIL.pvn_fund_info where fund_id=#{fundId} and isvalid=1
  158. </select>
  159. </mapper>