EmailFundNavMapper.xml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  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.EmailFundNavMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailFundNavDO">
  5. <id column="id" property="id"/>
  6. <result column="file_id" property="fileId"/>
  7. <result column="fund_id" property="fundId"/>
  8. <result column="fund_name" property="fundName"/>
  9. <result column="register_number" property="registerNumber"/>
  10. <result column="price_date" property="priceDate"/>
  11. <result column="nav" property="nav"/>
  12. <result column="cumulative_nav_withdrawal" property="cumulativeNavWithdrawal"/>
  13. <result column="is_stored" property="isStored"/>
  14. <result column="exception_status" property="exceptionStatus"/>
  15. <result column="isvalid" property="isvalid"/>
  16. <result column="creatorid" property="creatorId"/>
  17. <result column="createtime" property="createTime"/>
  18. <result column="updaterid" property="updaterId"/>
  19. <result column="updatetime" property="updateTime"/>
  20. </resultMap>
  21. <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundNavDO">
  22. insert into PPW_EMAIL.email_fund_nav(file_id, fund_id, fund_name,register_number,price_date,
  23. nav,cumulative_nav_withdrawal,is_stored,exception_status,
  24. isvalid, creatorid, createtime, updaterid, updatetime)
  25. values
  26. <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
  27. (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},
  28. #{itemDo.nav},#{itemDo.cumulativeNavWithdrawal},#{itemDo.isStored},#{itemDo.exceptionStatus},
  29. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  30. </foreach>
  31. </insert>
  32. <update id="batchUpdate">
  33. <foreach collection="navList" item="itemDo" index="index" open="" close="" separator=";">
  34. update PPW_EMAIL.email_fund_nav
  35. <set>
  36. fund_id = #{itemDo.fundId},
  37. exception_status = #{itemDo.exceptionStatus},
  38. updatetime=#{itemDo.updateTime}
  39. </set>
  40. where isvalid = 1
  41. and id = #{itemDo.id}
  42. </foreach>
  43. </update>
  44. <delete id="deleteByFileId" parameterType="java.lang.Integer">
  45. update PPW_EMAIL.email_fund_nav nav set isvalid = 0,updatetime=sysdate() where file_id=#{fileId}
  46. </delete>
  47. <select id="searchNavDetail" resultMap="BaseResultMap">
  48. SELECT distinct nav.id,
  49. nav.fund_id,
  50. nav.fund_name,
  51. nav.register_number,
  52. nav.price_date,
  53. nav.nav,
  54. nav.cumulative_nav_withdrawal,
  55. nav.exception_status,
  56. nav.is_stored,
  57. nav.updatetime
  58. FROM
  59. PPW_EMAIL.email_fund_nav nav
  60. WHERE nav.isvalid = 1
  61. <if test="fundName != null and fundName !=''">
  62. and nav.fund_name like concat('%',#{fundName},'%')
  63. </if>
  64. <if test="priceStartDate != null and priceStartDate !=''">
  65. and nav.price_date >= #{priceStartDate}
  66. </if>
  67. <if test="priceEndDate != null and priceEndDate !=''">
  68. and nav.price_date <![CDATA[ <= ]]> #{priceEndDate}
  69. </if>
  70. <if test="exceptionStatus != null">
  71. and nav.exception_status = #{exceptionStatus}
  72. </if>
  73. <if test="updateStartDate != null and updateStartDate !=''">
  74. and nav.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  75. </if>
  76. <if test="updateEndDate != null and updateEndDate !=''">
  77. and nav.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  78. </if>
  79. <if test="isStore != null">
  80. and nav.is_stored = #{isStore}
  81. </if>
  82. order by nav.fund_name desc,nav.price_date desc
  83. limit #{offset},#{pageSize}
  84. </select>
  85. <select id="countNavDetail" resultType="java.lang.Long"
  86. parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
  87. select count(1) from (
  88. SELECT distinct nav.id,
  89. nav.fund_id,
  90. nav.fund_name,
  91. nav.register_number,
  92. nav.price_date,
  93. nav.nav,
  94. nav.cumulative_nav_withdrawal,
  95. nav.exception_status,
  96. nav.is_stored,
  97. nav.updatetime
  98. FROM
  99. PPW_EMAIL.email_fund_nav nav
  100. WHERE nav.isvalid = 1
  101. <if test="fundName != null and fundName !=''">
  102. and nav.fund_name like concat('%',#{fundName},'%')
  103. </if>
  104. <if test="priceStartDate != null and priceStartDate !=''">
  105. and nav.price_date >= #{priceStartDate}
  106. </if>
  107. <if test="priceEndDate != null and priceEndDate !=''">
  108. and nav.price_date <![CDATA[ <= ]]> #{priceEndDate}
  109. </if>
  110. <if test="exceptionStatus != null">
  111. and nav.exception_status = #{exceptionStatus}
  112. </if>
  113. <if test="updateStartDate != null and updateStartDate !=''">
  114. and nav.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  115. </if>
  116. <if test="updateEndDate != null and updateEndDate !=''">
  117. and nav.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  118. </if>
  119. <if test="isStore != null">
  120. and nav.is_stored = #{isStore}
  121. </if>
  122. ) a
  123. </select>
  124. <select id="countNoStoreNav" resultType="java.lang.Integer" parameterType="java.lang.String">
  125. select count(nav.id)
  126. from PPW_EMAIL.email_fund_nav nav
  127. where nav.isvalid =1 and nav.exception_status=3
  128. and nav.fund_name=#{fundName}
  129. </select>
  130. <select id="selectFileIdByFundName" resultType="java.lang.Integer" parameterType="java.lang.String">
  131. select distinct nav.file_id from PPW_EMAIL.email_fund_nav nav where nav.isvalid =1 and nav.exception_status=3
  132. and nav.fund_name=#{fundName}
  133. </select>
  134. <select id="selectNotMappingNav" resultMap="BaseResultMap"
  135. parameterType="java.lang.String">
  136. select nav.id,
  137. nav.file_id,
  138. nav.fund_id,
  139. nav.fund_name,
  140. nav.register_number,
  141. nav.price_date,
  142. nav.nav,
  143. nav.cumulative_nav_withdrawal,
  144. nav.exception_status,
  145. nav.is_stored,
  146. nav.isvalid,
  147. nav.creatorid,
  148. nav.updaterid,
  149. nav.updatetime,
  150. nav.createtime
  151. from PPW_EMAIL.email_fund_nav nav
  152. where nav.isvalid =1 and nav.exception_status=3
  153. and nav.fund_name=#{fundName}
  154. </select>
  155. </mapper>