EmailFundAssetMapper.xml 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  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.EmailFundAssetMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.EmailFundAssetDO">
  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="asset_net" property="assetNet"/>
  12. <result column="asset_share" property="assetShare"/>
  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. <result column="email_title" property="emailTitle"/>
  21. </resultMap>
  22. <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundAssetDO">
  23. insert into PPW_EMAIL.email_fund_asset(file_id, fund_id, fund_name,register_number,price_date,asset_net,asset_share,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},#{itemDo.assetNet},#{itemDo.assetShare},#{itemDo.isStored},#{itemDo.exceptionStatus},
  28. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  29. </foreach>
  30. </insert>
  31. <update id="batchUpdate">
  32. <foreach collection="itemDoList" item="itemDo" index="index" open="" close="" separator=";">
  33. update PPW_EMAIL.email_fund_asset
  34. <set>
  35. fund_id = #{itemDo.fundId},
  36. exception_status = #{itemDo.exceptionStatus},
  37. updatetime=#{itemDo.updateTime},
  38. is_stored=#{itemDo.isStored}
  39. </set>
  40. where isvalid = 1
  41. and id = #{itemDo.id}
  42. </foreach>
  43. </update>
  44. <select id="searchAssetDetail" resultMap="BaseResultMap"
  45. parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
  46. select distinct asset.id,
  47. asset.fund_id,
  48. asset.fund_name,
  49. asset.register_number,
  50. asset.price_date,
  51. asset.asset_net,
  52. asset.asset_share,
  53. asset.is_stored,
  54. asset.exception_status,
  55. asset.updatetime,
  56. parse.email_title
  57. from PPW_EMAIL.email_fund_asset asset
  58. join PPW_EMAIL.email_file_info file
  59. on asset.file_id = file.id
  60. join PPW_EMAIL.email_parse_info parse
  61. on file.email_id = parse.id
  62. where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
  63. <if test="fundName != null and fundName !=''">
  64. and asset.fund_name like concat('%',#{fundName},'%')
  65. </if>
  66. <if test="priceStartDate != null and priceStartDate !=''">
  67. and asset.price_date >= #{priceStartDate}
  68. </if>
  69. <if test="priceEndDate != null and priceEndDate !=''">
  70. and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
  71. </if>
  72. <if test="updateStartDate != null and updateStartDate !=''">
  73. and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  74. </if>
  75. <if test="updateEndDate != null and updateEndDate !=''">
  76. and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  77. </if>
  78. <if test="isStore != null">
  79. and asset.is_stored = #{isStore}
  80. </if>
  81. <if test="emailTitle != null and emailTitle != ''">
  82. and parse.email_title like concat('%',#{emailTitle},'%')
  83. </if>
  84. <if test="exceptionStatusList != null">
  85. and asset.exception_status in
  86. <foreach collection="exceptionStatusList" index="index" item="exceptionStatus" separator="," open="(" close=")">
  87. #{exceptionStatus}
  88. </foreach>
  89. </if>
  90. order by asset.updatetime desc
  91. limit #{offset},#{pageSize}
  92. </select>
  93. <select id="countAssetDetail" resultType="java.lang.Long"
  94. parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
  95. select count(1) from (
  96. select distinct asset.id
  97. from PPW_EMAIL.email_fund_asset asset
  98. join PPW_EMAIL.email_file_info file
  99. on asset.file_id = file.id
  100. join PPW_EMAIL.email_parse_info parse
  101. on file.email_id = parse.id
  102. where asset.isvalid=1 and file.isvalid=1 and parse.isvalid=1
  103. <if test="fundName != null and fundName !=''">
  104. and asset.fund_name like concat('%',#{fundName},'%')
  105. </if>
  106. <if test="priceStartDate != null and priceStartDate !=''">
  107. and asset.price_date >= #{priceStartDate}
  108. </if>
  109. <if test="priceEndDate != null and priceEndDate !=''">
  110. and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
  111. </if>
  112. <if test="updateStartDate != null and updateStartDate !=''">
  113. and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  114. </if>
  115. <if test="updateEndDate != null and updateEndDate !=''">
  116. and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  117. </if>
  118. <if test="isStore != null">
  119. and asset.is_stored = #{isStore}
  120. </if>
  121. <if test="emailTitle != null and emailTitle != ''">
  122. and parse.email_title like concat('%',#{emailTitle},'%')
  123. </if>
  124. <if test="exceptionStatusList != null">
  125. and asset.exception_status in
  126. <foreach collection="exceptionStatusList" index="index" item="exceptionStatus" separator="," open="(" close=")">
  127. #{exceptionStatus}
  128. </foreach>
  129. </if>
  130. )a
  131. </select>
  132. <select id="countNoStoreAsset" resultType="java.lang.Integer" parameterType="java.lang.String">
  133. select count(id)
  134. from PPW_EMAIL.email_fund_asset
  135. where isvalid =1 and exception_status=3
  136. and fund_name=#{fundName}
  137. </select>
  138. <select id="selectNotMappingAsset" resultMap="BaseResultMap"
  139. parameterType="java.lang.String">
  140. select distinct id,fund_id,file_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
  141. updatetime
  142. from PPW_EMAIL.email_fund_asset
  143. where isvalid =1 and exception_status=3
  144. and fund_name=#{fundName}
  145. </select>
  146. <delete id="deleteByFileId">
  147. update PPW_EMAIL.email_fund_asset
  148. set isvalid = 0,
  149. updatetime= now()
  150. where isvalid = 1
  151. and file_id = #{fileId}
  152. </delete>
  153. </mapper>