EmailFundNavCollectionMapper.xml 4.2 KB

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