EmailFundAssetMapper.xml 4.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  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. </resultMap>
  21. <insert id="batchInsert" parameterType="com.simuwang.base.pojo.dos.EmailFundAssetDO">
  22. 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,
  23. isvalid, creatorid, createtime, updaterid, updatetime)
  24. values
  25. <foreach collection="itemDoList" item="itemDo" index="index" separator=",">
  26. (#{itemDo.fileId},#{itemDo.fundId},#{itemDo.fundName},#{itemDo.registerNumber},#{itemDo.priceDate},#{itemDo.assetNet},#{itemDo.assetShare},#{itemDo.isStored},#{itemDo.exceptionStatus},
  27. #{itemDo.isvalid}, #{itemDo.creatorId}, #{itemDo.createTime}, #{itemDo.updaterId}, #{itemDo.updateTime})
  28. </foreach>
  29. </insert>
  30. <select id="searchAssetDetail" resultMap="BaseResultMap"
  31. parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
  32. select distinct fund_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,updatetime
  33. from PPW_EMAIL.email_fund_asset asset where isvalid=1
  34. <if test="fundName != null and fundName !=''">
  35. and asset.fund_name like concat('%',#{fundName},'%')
  36. </if>
  37. <if test="priceStartDate != null and priceStartDate !=''">
  38. and asset.price_date >= #{priceStartDate}
  39. </if>
  40. <if test="priceEndDate != null and priceEndDate !=''">
  41. and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
  42. </if>
  43. <if test="exceptionStatus != null">
  44. and asset.exception_status = #{exceptionStatus}
  45. </if>
  46. <if test="updateStartDate != null and updateStartDate !=''">
  47. and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  48. </if>
  49. <if test="updateEndDate != null and updateEndDate !=''">
  50. and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  51. </if>
  52. <if test="isStore != null">
  53. and asset.is_stored = #{isStore}
  54. </if>
  55. order by asset.fund_name desc,asset.price_date desc
  56. limit #{offset},#{pageSize}
  57. </select>
  58. <select id="countAssetDetail" resultType="java.lang.Long"
  59. parameterType="com.simuwang.base.pojo.dto.query.ParseDetailPageQuery">
  60. select count(1) from (
  61. select distinct fund_id, fund_name,register_number,price_date,asset_net,asset_share,is_stored,exception_status,
  62. updatetime
  63. from PPW_EMAIL.email_fund_asset asset where isvalid=1
  64. <if test="fundName != null and fundName !=''">
  65. and asset.fund_name like concat('%',#{fundName},'%')
  66. </if>
  67. <if test="priceStartDate != null and priceStartDate !=''">
  68. and asset.price_date >= #{priceStartDate}
  69. </if>
  70. <if test="priceEndDate != null and priceEndDate !=''">
  71. and asset.price_date <![CDATA[ <= ]]> #{priceEndDate}
  72. </if>
  73. <if test="exceptionStatus != null">
  74. and asset.exception_status = #{exceptionStatus}
  75. </if>
  76. <if test="updateStartDate != null and updateStartDate !=''">
  77. and asset.updatetime <![CDATA[ >= ]]> #{updateStartDate}
  78. </if>
  79. <if test="updateEndDate != null and updateEndDate !=''">
  80. and asset.updatetime <![CDATA[ <= ]]> #{updateEndDate}
  81. </if>
  82. <if test="isStore != null">
  83. and asset.is_stored = #{isStore}
  84. </if>
  85. )a
  86. </select>
  87. <delete id="deleteByFileId">
  88. update PPW_EMAIL.email_fund_asset
  89. set isvalid = 0,
  90. updatetime= now()
  91. where isvalid = 1
  92. and file_id = #{fileId}
  93. </delete>
  94. </mapper>