IndexesRzIndexMapper.xml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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.core.IndexesRzIndexMapper">
  4. <resultMap id="BaseResultMap" type="com.smppw.analysis.domain.dataobject.nav.IndexesRzIndexDo">
  5. <!--@mbg.generated-->
  6. <!--@Table indexes_rz_index-->
  7. <id column="id" property="id" />
  8. <result column="index_id" property="indexId" />
  9. <result column="index_code" property="indexCode" />
  10. <result column="end_date" property="endDate" />
  11. <result column="yearofweek" property="yearofweek" />
  12. <result column="weeks" property="weeks" />
  13. <result column="strategy" property="strategy" />
  14. <result column="substrategy" property="substrategy" />
  15. <result column="third_strategy" property="thirdStrategy" />
  16. <result column="last_index_value" property="lastIndexValue" />
  17. <result column="index_value" property="indexValue" />
  18. <result column="ret_1w" property="ret1w" />
  19. <result column="incl_cal_fund_count" property="inclCalFundCount" />
  20. <result column="total_fund_count" property="totalFundCount" />
  21. <result column="isstrategy" property="isstrategy" />
  22. <result column="creatorid" property="creatorid" />
  23. <result column="createtime" property="createtime" />
  24. <result column="updaterid" property="updaterid" />
  25. <result column="updatetime" property="updatetime" />
  26. <result column="isvalid" property="isvalid" />
  27. </resultMap>
  28. <sql id="Base_Column_List">
  29. <!--@mbg.generated-->
  30. id, index_id, index_code, end_date, yearofweek, weeks, strategy, substrategy, third_strategy,
  31. last_index_value, index_value, ret_1w, incl_cal_fund_count, total_fund_count, isstrategy,
  32. creatorid, createtime, updaterid, updatetime, isvalid
  33. </sql>
  34. <select id="listNav" resultMap="BaseResultMap">
  35. select
  36. <include refid="Base_Column_List"/>
  37. from indexes_rz_index where isvalid = 1
  38. <if test="startDate != null and startDate != ''">
  39. AND end_date &gt;= #{startDate}
  40. </if>
  41. <if test="endDate != null and endDate != ''">
  42. AND end_date &lt;= #{endDate}
  43. </if>
  44. AND index_id in
  45. <foreach collection="indexIds" item="indexId" index="index" open="(" separator="," close=")">
  46. #{indexId}
  47. </foreach>
  48. </select>
  49. <select id="listNavByTimeInterval" resultMap="BaseResultMap">
  50. select index_id, end_date, index_value
  51. <if test="needUpdateAndCreateTime">
  52. , updatetime, createtime
  53. </if>
  54. from indexes_rz_index where isvalid = 1
  55. <if test="startDate != null and startDate != ''">
  56. AND end_date &gt;= #{startDate}
  57. </if>
  58. <if test="endDate != null and endDate != ''">
  59. AND end_date &lt;= #{endDate}
  60. </if>
  61. AND index_id in
  62. <foreach collection="indexIdList" item="indexId" index="index" open="(" separator="," close=")">
  63. #{indexId}
  64. </foreach>
  65. </select>
  66. <select id="isExist" resultType="java.lang.Integer">
  67. select count(id) from indexes_rz_index where index_id = #{indexId} and isvalid = 1
  68. </select>
  69. </mapper>