|
|
@@ -10,9 +10,11 @@
|
|
|
<result column="operator" jdbcType="VARCHAR" property="operator" />
|
|
|
<result column="comment" jdbcType="VARCHAR" property="comment" />
|
|
|
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
+ <result column="count_amount" jdbcType="DECIMAL" property="countAmount" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, initiate_amb_id, accept_amb_id, amount, `status`, `operator`, `comment`, create_time
|
|
|
+ id, initiate_amb_id, accept_amb_id, amount, `status`, `operator`, `comment`, create_time,
|
|
|
+ count_amount
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
select
|
|
|
@@ -27,10 +29,10 @@
|
|
|
<insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
|
|
|
insert into amb_invest (initiate_amb_id, accept_amb_id, amount,
|
|
|
`status`, `operator`, `comment`,
|
|
|
- create_time)
|
|
|
+ create_time, count_amount)
|
|
|
values (#{initiateAmbId,jdbcType=BIGINT}, #{acceptAmbId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL},
|
|
|
#{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
|
|
|
- #{createTime,jdbcType=TIMESTAMP})
|
|
|
+ #{createTime,jdbcType=TIMESTAMP}, #{countAmount,jdbcType=DECIMAL})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
|
|
|
insert into amb_invest
|
|
|
@@ -56,6 +58,9 @@
|
|
|
<if test="createTime != null">
|
|
|
create_time,
|
|
|
</if>
|
|
|
+ <if test="countAmount != null">
|
|
|
+ count_amount,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="initiateAmbId != null">
|
|
|
@@ -79,6 +84,9 @@
|
|
|
<if test="createTime != null">
|
|
|
#{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="countAmount != null">
|
|
|
+ #{countAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvest">
|
|
|
@@ -105,6 +113,9 @@
|
|
|
<if test="createTime != null">
|
|
|
create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
</if>
|
|
|
+ <if test="countAmount != null">
|
|
|
+ count_amount = #{countAmount,jdbcType=DECIMAL},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
@@ -116,7 +127,8 @@
|
|
|
`status` = #{status,jdbcType=INTEGER},
|
|
|
`operator` = #{operator,jdbcType=VARCHAR},
|
|
|
`comment` = #{comment,jdbcType=VARCHAR},
|
|
|
- create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ count_amount = #{countAmount,jdbcType=DECIMAL}
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
|
|
|
@@ -144,4 +156,9 @@
|
|
|
and a.status in (1,2,3)
|
|
|
</if>
|
|
|
</select>
|
|
|
+ <select id="selectCountAmountById" resultType="java.lang.Integer">
|
|
|
+ select sum(amount)amount
|
|
|
+ from amb_invest
|
|
|
+ where accept_amb_id = #{id}
|
|
|
+ </select>
|
|
|
</mapper>
|