EmailFundNavCollectionMapper.xml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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.daq.EmailFundNavCollectionMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailFundNavCollectionDO">
  5. <id column="id" property="id"/>
  6. <result column="file_id" property="fileId"/>
  7. <result column="fund_name" property="fundName"/>
  8. <result column="register_number" property="registerNumber"/>
  9. <result column="price_date" property="priceDate"/>
  10. <result column="parse_date" property="parseDate"/>
  11. <result column="nav" property="nav"/>
  12. <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal"/>
  13. <result column="asset_net" property="assetNet"/>
  14. <result column="asset_share" property="assetShare"/>
  15. <result column="exception_status" property="exceptionStatus"/>
  16. <result column="template_id" property="templateId"/>
  17. <result column="isvalid" property="isvalid"/>
  18. <result column="creatorid" property="creatorId"/>
  19. <result column="createtime" property="createTime"/>
  20. <result column="updaterid" property="updaterId"/>
  21. <result column="updatetime" property="updateTime"/>
  22. </resultMap>
  23. <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundNavDO">
  24. insert into email_fund_nav_collection(file_id, fund_name,register_number,price_date,
  25. nav,cumulative_nav_withdrawal,exception_status,template_id,
  26. isvalid, creatorid, createtime, updaterid, updatetime,asset_net,asset_share,parse_date,email,sender_email,email_date)
  27. values
  28. <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
  29. (#{itemDo.fileId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},
  30. #{itemDo.nav},#{itemDo.cumulativeNavWithdrawal},#{itemDo.exceptionStatus},#{itemDo.templateId},
  31. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime},
  32. #{itemDo.assetNet}, #{itemDo.assetShare}, #{itemDo.parseDate}, #{itemDo.email}, #{itemDo.sender_email}, #{itemDo.email_date})
  33. </foreach>
  34. </insert>
  35. <select id="countByFileId" resultType="java.lang.Long" parameterType="java.lang.Integer">
  36. select count(*) from email_fund_nav_collection where file_id=#{fileId} and isvalid=1
  37. </select>
  38. <select id="selectEmailFundNavCollectionDOByFileId" resultMap="BaseResultMap">
  39. select id,file_id, fund_name,register_number,price_date,
  40. nav,cumulative_nav_withdrawal,exception_status,template_id,
  41. isvalid, creatorid, createtime, updaterid, updatetime,asset_net,
  42. asset_share,parse_date,email,sender_email,email_date
  43. from email_fund_nav_collection where file_id=#{fileId} and isvalid=1
  44. order by price_date desc
  45. limit #{offset},#{pageSize}
  46. </select>
  47. <select id="countDataByExceptionStatus" resultType="java.lang.Long">
  48. select count(1) as total from email_fund_nav_collection where isvalid=1
  49. <if test="item.startDate != null and item.startDate != ''">
  50. and email_date >= #{item.startDate}
  51. </if>
  52. <if test="item.endDate != null and item.endDate != ''">
  53. and email_date <![CDATA[ <= ]]> #{item.endDate}
  54. </if>
  55. <if test="item.email !=null and item.email !=''">
  56. and email like concat('%',#{item.email},'%')
  57. </if>
  58. <if test="item.senderEmail !=null and item.senderEmail !=''">
  59. and sender_email like concat('%',#{item.senderEmail},'%')
  60. </if>
  61. <if test="exceptionStatus !=null and exceptionStatus !=''">
  62. and exception_status = #{exceptionStatus}
  63. </if>
  64. </select>
  65. </mapper>