NavDoMapper.xml 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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.NavDoMapper">
  4. <resultMap id="BaseResultMap" type="com.smppw.analysis.domain.dataobject.NavDo">
  5. <!--@mbg.generated-->
  6. <!--@Table nav-->
  7. <id column="id" property="id" />
  8. <result column="fund_id" property="fundId" />
  9. <result column="price_date" property="priceDate" />
  10. <result column="nav" property="nav" />
  11. <result column="cumulative_nav" property="cumulativeNav" />
  12. <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal" />
  13. <result column="ishigh_or_low" property="ishighOrLow" />
  14. <result column="tohigh_nav_ratio" property="tohighNavRatio" />
  15. <result column="creatorid" property="creatorid" />
  16. <result column="createtime" property="createtime" />
  17. <result column="updaterid" property="updaterid" />
  18. <result column="updatetime" property="updatetime" />
  19. <result column="isvalid" property="isvalid" />
  20. </resultMap>
  21. <sql id="Base_Column_List">
  22. <!--@mbg.generated-->
  23. id, fund_id, price_date, nav, cumulative_nav, cumulative_nav_withdrawal, ishigh_or_low,
  24. tohigh_nav_ratio, creatorid, createtime, updaterid, updatetime, isvalid
  25. </sql>
  26. <select id="listNavByTimeInterval" resultMap="BaseResultMap">
  27. select fund_id, price_date, ${navFieldSql}
  28. <if test="needUpdateAndCreateTime">
  29. , updatetime, createtime
  30. </if>
  31. from nav where isvalid = 1
  32. <if test="startDate != null and startDate != ''">
  33. AND price_date &gt;= #{startDate}
  34. </if>
  35. <if test="endDate != null and endDate != ''">
  36. AND price_date &lt;= #{endDate}
  37. </if>
  38. AND fund_id in
  39. <foreach collection="fundIdList" item="fundId" index="index" open="(" separator="," close=")">
  40. #{fundId}
  41. </foreach>
  42. </select>
  43. <select id="selectFundIdByStartTime" resultType="com.smppw.analysis.domain.dataobject.NavDo">
  44. select fund_id as fundId, updatetime as updatetime
  45. from nav
  46. where isvalid = 1
  47. AND updatetime &gt; #{startTime}
  48. </select>
  49. </mapper>