IndexesRzIndexDoMapper.xml 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.persistence.IndexesRzIndexDoMapper">
  4. <resultMap id="BaseResultMap" type="com.smppw.analysis.domain.dataobject.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="listNavByTimeInterval" resultMap="BaseResultMap">
  35. select index_id, end_date, index_value
  36. <if test="needUpdateAndCreateTime">
  37. , updatetime, createtime
  38. </if>
  39. from indexes_rz_index where isvalid = 1
  40. <if test="startDate != null and startDate != ''">
  41. AND end_date &gt;= #{startDate}
  42. </if>
  43. <if test="endDate != null and endDate != ''">
  44. AND end_date &lt;= #{endDate}
  45. </if>
  46. AND index_id in
  47. <foreach collection="indexIdList" item="indexId" index="index" open="(" separator="," close=")">
  48. #{indexId}
  49. </foreach>
  50. </select>
  51. <select id="isExist" resultType="java.lang.Integer">
  52. select count(id) from indexes_rz_index where index_id = #{indexId} and isvalid = 1
  53. </select>
  54. </mapper>