NavMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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.NavMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.NavDO">
  5. <id column="id" property="id"/>
  6. <result column="fund_id" property="fundId"/>
  7. <result column="price_date" property="priceDate"/>
  8. <result column="nav" property="nav"/>
  9. <result column="cumulative_nav" property="cumulativeNav"/>
  10. <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal"/>
  11. <result column="isvalid" property="isvalid"/>
  12. <result column="creatorid" property="creatorId"/>
  13. <result column="createtime" property="createTime"/>
  14. <result column="updaterid" property="updaterId"/>
  15. <result column="updatetime" property="updateTime"/>
  16. </resultMap>
  17. <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.NavDO">
  18. insert into PPW_EMAIL.nav(fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
  19. isvalid, creatorid, createtime, updaterid, updatetime)
  20. values
  21. <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
  22. (#{itemDo.fundId},#{itemDo.priceDate},#{itemDo.nav},#{itemDo.cumulativeNav},#{itemDo.cumulativeNavWithdrawal},
  23. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  24. </foreach>
  25. </insert>
  26. <insert id="batchUpdate">
  27. <foreach collection="itemDoList" item="itemDo" index="index" open="" close="" separator=";">
  28. update PPW_EMAIL.nav
  29. <set>
  30. nav = #{itemDo.nav},
  31. cumulative_nav_withdrawal = #{itemDo.cumulativeNavWithdrawal},
  32. updatetime=#{itemDo.updateTime}
  33. </set>
  34. where isvalid = 1
  35. and fund_id = #{itemDo.fundId}
  36. and price_date = #{itemDo.priceDate}
  37. </foreach>
  38. </insert>
  39. <select id="queryFundNavByDate" resultType="java.lang.String">
  40. select price_date
  41. from PPW_EMAIL.nav
  42. where isvalid = 1
  43. and fund_id = #{fundId}
  44. and price_date in
  45. <foreach collection="priceDateList" index="index" item="priceDate" separator="," open="(" close=")">
  46. #{priceDate}
  47. </foreach>
  48. </select>
  49. <select id="queryFundNav" resultMap="BaseResultMap"
  50. parameterType="com.simuwang.base.pojo.dos.NavDO">
  51. SELECT id, fund_id,price_date,nav,cumulative_nav,cumulative_nav_withdrawal,
  52. isvalid, creatorid, createtime, updaterid, updatetime
  53. from PPW_EMAIL.nav
  54. where isvalid = 1
  55. and fund_id = #{fundId}
  56. and price_date=#{priceDate}
  57. </select>
  58. </mapper>