AmbInvestLogMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  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.goafanti.common.dao.AmbInvestLogMapper">
  4. <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbInvestLog">
  5. <id column="id" jdbcType="BIGINT" property="id" />
  6. <result column="amb_invest_id" jdbcType="BIGINT" property="ambInvestId" />
  7. <result column="amount" jdbcType="DECIMAL" property="amount" />
  8. <result column="status" jdbcType="INTEGER" property="status" />
  9. <result column="comment" jdbcType="VARCHAR" property="comment" />
  10. <result column="operator" jdbcType="VARCHAR" property="operator" />
  11. <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
  12. </resultMap>
  13. <sql id="Base_Column_List">
  14. id, amb_invest_id, amount, `status`, `comment`, `operator`, create_time
  15. </sql>
  16. <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
  17. select
  18. <include refid="Base_Column_List" />
  19. from amb_invest_log
  20. where id = #{id,jdbcType=BIGINT}
  21. </select>
  22. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
  23. delete from amb_invest_log
  24. where id = #{id,jdbcType=BIGINT}
  25. </delete>
  26. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
  27. insert into amb_invest_log (amb_invest_id, amount, `status`,
  28. `comment`, `operator`, create_time
  29. )
  30. values (#{ambInvestId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL}, #{status,jdbcType=INTEGER},
  31. #{comment,jdbcType=VARCHAR}, #{operator,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}
  32. )
  33. </insert>
  34. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvestLog" useGeneratedKeys="true">
  35. insert into amb_invest_log
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="ambInvestId != null">
  38. amb_invest_id,
  39. </if>
  40. <if test="amount != null">
  41. amount,
  42. </if>
  43. <if test="status != null">
  44. `status`,
  45. </if>
  46. <if test="comment != null">
  47. `comment`,
  48. </if>
  49. <if test="operator != null">
  50. `operator`,
  51. </if>
  52. <if test="createTime != null">
  53. create_time,
  54. </if>
  55. </trim>
  56. <trim prefix="values (" suffix=")" suffixOverrides=",">
  57. <if test="ambInvestId != null">
  58. #{ambInvestId,jdbcType=BIGINT},
  59. </if>
  60. <if test="amount != null">
  61. #{amount,jdbcType=DECIMAL},
  62. </if>
  63. <if test="status != null">
  64. #{status,jdbcType=INTEGER},
  65. </if>
  66. <if test="comment != null">
  67. #{comment,jdbcType=VARCHAR},
  68. </if>
  69. <if test="operator != null">
  70. #{operator,jdbcType=VARCHAR},
  71. </if>
  72. <if test="createTime != null">
  73. #{createTime,jdbcType=TIMESTAMP},
  74. </if>
  75. </trim>
  76. </insert>
  77. <update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvestLog">
  78. update amb_invest_log
  79. <set>
  80. <if test="ambInvestId != null">
  81. amb_invest_id = #{ambInvestId,jdbcType=BIGINT},
  82. </if>
  83. <if test="amount != null">
  84. amount = #{amount,jdbcType=DECIMAL},
  85. </if>
  86. <if test="status != null">
  87. `status` = #{status,jdbcType=INTEGER},
  88. </if>
  89. <if test="comment != null">
  90. `comment` = #{comment,jdbcType=VARCHAR},
  91. </if>
  92. <if test="operator != null">
  93. `operator` = #{operator,jdbcType=VARCHAR},
  94. </if>
  95. <if test="createTime != null">
  96. create_time = #{createTime,jdbcType=TIMESTAMP},
  97. </if>
  98. </set>
  99. where id = #{id,jdbcType=BIGINT}
  100. </update>
  101. <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbInvestLog">
  102. update amb_invest_log
  103. set amb_invest_id = #{ambInvestId,jdbcType=BIGINT},
  104. amount = #{amount,jdbcType=DECIMAL},
  105. `status` = #{status,jdbcType=INTEGER},
  106. `comment` = #{comment,jdbcType=VARCHAR},
  107. `operator` = #{operator,jdbcType=VARCHAR},
  108. create_time = #{createTime,jdbcType=TIMESTAMP}
  109. where id = #{id,jdbcType=BIGINT}
  110. </update>
  111. <select id="selectByAmbInvestId" resultType="com.goafanti.ambSystem.bo.OutInvestLog">
  112. select a.id ,a.amb_invest_id ambInvestId ,a.status ,a.comment ,b.name operator,
  113. date_format(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes
  114. from amb_invest_log a left join admin b on a.operator =b.id
  115. where amb_invest_id = #{id}
  116. </select>
  117. </mapper>