IndexesProfileDoMapper.xml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  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.smppw.analysis.domain.mapper.IndexesProfileDoMapper">
  4. <resultMap id="BaseResultMap" type="com.smppw.analysis.domain.dataobject.IndexesProfileDo">
  5. <!--@mbg.generated-->
  6. <!--@Table indexes_profile-->
  7. <id column="id" property="id"/>
  8. <result column="index_id" property="indexId"/>
  9. <result column="index_type" property="indexType"/>
  10. <result column="index_type_second" property="indexTypeSecond"/>
  11. <result column="index_type_third" property="indexTypeThird"/>
  12. <result column="index_type_id" property="indexTypeId"/>
  13. <result column="index_code" property="indexCode"/>
  14. <result column="index_name" property="indexName"/>
  15. <result column="index_short_name" property="indexShortName"/>
  16. <result column="index_area_flag" property="indexAreaFlag"/>
  17. <result column="index_family_id" property="indexFamilyId"/>
  18. <result column="pricing_frequency" property="pricingFrequency"/>
  19. <result column="inception_date" property="inceptionDate"/>
  20. <result column="index_initial_value" property="indexInitialValue"/>
  21. <result column="base_currency" property="baseCurrency"/>
  22. <result column="calculation_method" property="calculationMethod"/>
  23. <result column="weighting_scheme" property="weightingScheme"/>
  24. <result column="selection_scheme" property="selectionScheme"/>
  25. <result column="reconstitution_frequency" property="reconstitutionFrequency"/>
  26. <result column="rebalance_frequency" property="rebalanceFrequency"/>
  27. <result column="isvisible" property="isvisible"/>
  28. <result column="creatorid" property="creatorid"/>
  29. <result column="createtime" property="createtime"/>
  30. <result column="updaterid" property="updaterid"/>
  31. <result column="updatetime" property="updatetime"/>
  32. <result column="isvalid" property="isvalid"/>
  33. <result column="qc" property="qc"/>
  34. <result column="qcdate" property="qcdate"/>
  35. <result column="qcstate" property="qcstate"/>
  36. <result column="auditor" property="auditor"/>
  37. <result column="auditdate" property="auditdate"/>
  38. <result column="auditstate" property="auditstate"/>
  39. <result column="qcremark" property="qcremark"/>
  40. <result column="auditremark" property="auditremark"/>
  41. <result column="remark" property="remark"/>
  42. </resultMap>
  43. <sql id="Base_Column_List">
  44. <!--@mbg.generated-->
  45. id,
  46. index_id,
  47. index_type,
  48. index_type_second,
  49. index_type_third,
  50. index_type_id,
  51. index_code,
  52. index_name,
  53. index_short_name,
  54. index_area_flag,
  55. index_family_id,
  56. pricing_frequency,
  57. inception_date,
  58. index_initial_value,
  59. base_currency,
  60. calculation_method,
  61. weighting_scheme,
  62. selection_scheme,
  63. reconstitution_frequency,
  64. rebalance_frequency,
  65. isvisible,
  66. creatorid,
  67. createtime,
  68. updaterid,
  69. updatetime,
  70. isvalid,
  71. qc,
  72. qcdate,
  73. qcstate,
  74. auditor,
  75. auditdate,
  76. auditstate,
  77. qcremark,
  78. auditremark,
  79. remark
  80. </sql>
  81. <select id="listThirdIndexes" resultType="java.lang.String">
  82. select distinct index_id
  83. from indexes_profile
  84. where index_type = 1
  85. AND index_type_second = 111
  86. </select>
  87. <select id="listFundIdAndFundShortName" resultMap="BaseResultMap">
  88. select index_id, index_short_name
  89. from indexes_profile where isvalid = 1
  90. AND index_id in
  91. <foreach collection="indexIdList" item="indexId" index="index" open="(" separator="," close=")">
  92. #{indexId}
  93. </foreach>
  94. </select>
  95. <select id="listInfoByIndexIdList" resultMap="BaseResultMap">
  96. select
  97. <include refid="Base_Column_List"/>
  98. from rz_hfdb_core.indexes_profile
  99. where index_id in
  100. <foreach collection="indexIdList" index="index" item="indexId" open="(" separator="," close=")">
  101. #{indexId}
  102. </foreach>
  103. </select>
  104. <select id="getIndexNameByIndexId" resultType="java.lang.String">
  105. select index_name
  106. from rz_hfdb_core.indexes_profile
  107. where index_id = #{indexId}
  108. and isvalid = 1
  109. </select>
  110. <select id="getStrategyIndexId" parameterType="int" resultType="string">
  111. select a.index_id from indexes_profile a where a.index_type_second = 102 and a.remark = #{strategyId} and a.isvalid = 1 limit 1
  112. </select>
  113. </mapper>