FundInformationMapper.xml 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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.FundInfomationMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.FundInformationDO">
  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" parameterType="java.lang.String">
  31. select f.fund_id as fundId,
  32. f.fund_short_name as fundShortName,
  33. f.register_number as registerNumber
  34. from PPW_EMAIL.fund_information 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},'%'))
  37. </if>
  38. </select>
  39. <select id="searchFundInfoList" resultType="com.simuwang.base.pojo.vo.FundInformationVO">
  40. select f.fund_id as fundId,
  41. f.fund_short_name as fundShortName,
  42. c.company_short_name as companyShortName,
  43. f.inception_date as inceptionDate,
  44. n.last_price_date as lastPriceDate,
  45. r.nav_frequency as navFrequency,
  46. r.asset_Frequency as assetFrequency,
  47. r.frequency_remark as frequencyRemark
  48. from PPW_EMAIL.fund_information f
  49. join PPW_EMAIL.company_information c on f.trust_id = c.company_id
  50. 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
  51. on f.fund_id = n .fund_id
  52. left join PPW_EMAIL.fund_report_frequency r on r.fund_id = f.fund_id and r.isvalid =1
  53. where f.isvalid =1 and c.isvalid =1
  54. <if test="fundId != null and fundId !=''">
  55. and f.fund_id like concat('%',#{fundId},'%')
  56. </if>
  57. <if test="fundName != null and fundName !=''">
  58. and (f.fund_name like concat('%',#{fundName},'%') or f.fund_short_name like concat('%',#{fundName},'%'))
  59. </if>
  60. <if test="companyName != null and companyName !=''">
  61. and (c.company_name like concat('%',#{companyName},'%') or c.company_short_name like concat('%',#{companyName},'%'))
  62. </if>
  63. <if test="navFrequency != null and navFrequency !=''">
  64. and r.nav_frequency = #{navFrequency}
  65. </if>
  66. <if test="assetFrequency != null and assetFrequency !=''">
  67. and r.asset_Frequency = #{navFrequency}
  68. </if>
  69. <if test="startDate != null and startDate !=''">
  70. and r.inception_date <![CDATA[ >= ]]> #{startDate}
  71. </if>
  72. <if test="endDate != null and endDate !=''">
  73. and r.inception_date <![CDATA[ <= ]]> #{endDate}
  74. </if>
  75. </select>
  76. <select id="queryFundByNameAndRegisterNumber" resultType="java.lang.String">
  77. select fund_id
  78. from PPW_EMAIL.fund_information
  79. where isvalid = 1
  80. and fund_name = #{fundName}
  81. and register_number = #{registerNumber}
  82. </select>
  83. <select id="queryFundByName" resultType="java.lang.String">
  84. select fund_id
  85. from PPW_EMAIL.fund_information
  86. where isvalid = 1
  87. and fund_name = #{fundName}
  88. </select>
  89. <select id="queryFundByRegisterNumber" resultType="java.lang.String">
  90. select fund_id
  91. from PPW_EMAIL.fund_information
  92. where isvalid = 1
  93. and register_number = #{registerNumber}
  94. </select>
  95. </mapper>