ValuationTableMapper.xml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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.ValuationTableMapper">
  4. <resultMap id="BaseResultMap" type="com.simuwang.base.pojo.dos.ValuationTableDO">
  5. <id column="id" property="id"/>
  6. <result column="file_id" property="fileId"/>
  7. <result column="fund_id" property="fundId"/>
  8. <result column="title" property="title"/>
  9. <result column="valuation_date" property="valuationDate"/>
  10. <result column="head_info" property="headInfo"/>
  11. <result column="tail_info" property="tailInfo"/>
  12. <result column="original_file" property="originalFile"/>
  13. <result column="converted_file" property="convertedFile"/>
  14. <result column="file_url" property="fileUrl"/>
  15. <result column="table_type" property="tableType"/>
  16. <result column="is_analyzed" property="isAnalyzed"/>
  17. <result column="total_market_value" property="totalMarketValue"/>
  18. <result column="net_assets_value" property="netAssetsValue"/>
  19. <result column="nav" property="nav"/>
  20. <result column="increment" property="increment"/>
  21. <result column="from_email" property="fromEmail"/>
  22. <result column="has_stock" property="hasStock"/>
  23. <result column="has_bond" property="hasBond"/>
  24. <result column="has_future" property="hasFuture"/>
  25. <result column="isvalid" property="isvalid"/>
  26. <result column="creatorid" property="creatorId"/>
  27. <result column="createtime" property="createTime"/>
  28. <result column="updaterid" property="updaterId"/>
  29. <result column="updatetime" property="updateTime"/>
  30. </resultMap>
  31. <update id="unValid">
  32. update PPW_EMAIL.valuation_table
  33. set isvalid = 0
  34. where file_id = #{fileId}
  35. </update>
  36. <select id="selectValuationTableByFundId" resultMap="BaseResultMap"
  37. parameterType="java.lang.String">
  38. select distinct fund_id,valuation_date from PPW_EMAIL.valuation_table where fund_id=#{fundId} and isvalid=1 and valuation_date is not null
  39. </select>
  40. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.simuwang.base.pojo.dos.ValuationTableDO" useGeneratedKeys="true">
  41. <!--@mbg.generated-->
  42. insert into PPW_EMAIL.valuation_table (fund_id,file_id,
  43. title, valuation_date, nav,
  44. head_info, tail_info, original_file,
  45. converted_file, file_url, table_type,
  46. isvalid, creatorid, createtime,
  47. updaterid, updatetime, is_analyzed,
  48. total_market_value,net_assets_value,increment,from_email)
  49. values (#{fundId,jdbcType=VARCHAR},#{fileId,jdbcType=INTEGER},
  50. #{title,jdbcType=VARCHAR}, #{valuationDate,jdbcType=DATE}, #{nav,jdbcType=DECIMAL},
  51. #{headInfo,jdbcType=VARCHAR}, #{tailInfo,jdbcType=VARCHAR}, #{originalFile,jdbcType=VARCHAR},
  52. #{convertedFile,jdbcType=VARCHAR}, #{fileUrl,jdbcType=VARCHAR}, #{tableType,jdbcType=TINYINT},
  53. #{isvalid,jdbcType=INTEGER}, #{creatorId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
  54. #{updaterId,jdbcType=INTEGER}, #{updateTime,jdbcType=TIMESTAMP}, #{isAnalyzed,jdbcType=TINYINT},
  55. #{totalMarketValue,jdbcType=DECIMAL},#{netAssetsValue,jdbcType=DECIMAL},#{increment,jdbcType=DECIMAL},
  56. #{fromEmail,jdbcType=TINYINT})
  57. </insert>
  58. <update id="updateUpdateAnalyzed">
  59. update PPW_EMAIL.valuation_table
  60. set is_analyzed = 1,
  61. has_stock = #{hasStock},
  62. has_bond = #{hasBond},
  63. has_future = #{hasFuture}
  64. where valuation_date = #{valuationDate}
  65. and fund_id = #{fundId}
  66. and isvalid = 1
  67. </update>
  68. </mapper>