|
|
@@ -9,12 +9,13 @@
|
|
|
<result column="status" jdbcType="INTEGER" property="status" />
|
|
|
<result column="operator" jdbcType="VARCHAR" property="operator" />
|
|
|
<result column="comment" jdbcType="VARCHAR" property="comment" />
|
|
|
+ <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
|
|
|
</resultMap>
|
|
|
<sql id="Base_Column_List">
|
|
|
- id, initiate_amb_id, accept_amb_id, amount, `status`, `operator`, `comment`
|
|
|
+ id, initiate_amb_id, accept_amb_id, amount, `status`, `operator`, `comment`, create_time
|
|
|
</sql>
|
|
|
<select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
|
|
|
- select
|
|
|
+ select
|
|
|
<include refid="Base_Column_List" />
|
|
|
from amb_invest
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
@@ -24,12 +25,12 @@
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</delete>
|
|
|
<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`
|
|
|
- )
|
|
|
- values (#{initiateAmbId,jdbcType=BIGINT}, #{acceptAmbId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL},
|
|
|
- #{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR}
|
|
|
- )
|
|
|
+ insert into amb_invest (initiate_amb_id, accept_amb_id, amount,
|
|
|
+ `status`, `operator`, `comment`,
|
|
|
+ create_time)
|
|
|
+ values (#{initiateAmbId,jdbcType=BIGINT}, #{acceptAmbId,jdbcType=BIGINT}, #{amount,jdbcType=DECIMAL},
|
|
|
+ #{status,jdbcType=INTEGER}, #{operator,jdbcType=VARCHAR}, #{comment,jdbcType=VARCHAR},
|
|
|
+ #{createTime,jdbcType=TIMESTAMP})
|
|
|
</insert>
|
|
|
<insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
|
|
|
insert into amb_invest
|
|
|
@@ -52,6 +53,9 @@
|
|
|
<if test="comment != null">
|
|
|
`comment`,
|
|
|
</if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time,
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
<if test="initiateAmbId != null">
|
|
|
@@ -72,6 +76,9 @@
|
|
|
<if test="comment != null">
|
|
|
#{comment,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
</trim>
|
|
|
</insert>
|
|
|
<update id="updateByPrimaryKeySelective" parameterType="com.goafanti.common.model.AmbInvest">
|
|
|
@@ -95,6 +102,9 @@
|
|
|
<if test="comment != null">
|
|
|
`comment` = #{comment,jdbcType=VARCHAR},
|
|
|
</if>
|
|
|
+ <if test="createTime != null">
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP},
|
|
|
+ </if>
|
|
|
</set>
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
@@ -105,7 +115,33 @@
|
|
|
amount = #{amount,jdbcType=DECIMAL},
|
|
|
`status` = #{status,jdbcType=INTEGER},
|
|
|
`operator` = #{operator,jdbcType=VARCHAR},
|
|
|
- `comment` = #{comment,jdbcType=VARCHAR}
|
|
|
+ `comment` = #{comment,jdbcType=VARCHAR},
|
|
|
+ create_time = #{createTime,jdbcType=TIMESTAMP}
|
|
|
where id = #{id,jdbcType=BIGINT}
|
|
|
</update>
|
|
|
-</mapper>
|
|
|
+
|
|
|
+ <select id="selectInvestList" resultType="com.goafanti.ambSystem.bo.OutInvestList">
|
|
|
+ select a.id,b.name initiateName,c.name acceptName,a.amount ,a.status ,d.name operator,a.comment ,
|
|
|
+ date_format(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes
|
|
|
+ from amb_invest a left join amb_system b on a.initiate_amb_id =b.id
|
|
|
+ left join amb_system c on a.accept_amb_id =c.id
|
|
|
+ left join admin d on a.operator =d.id
|
|
|
+ where 1=1
|
|
|
+ <if test="roleType==1">
|
|
|
+ and a.status in (1,2,3)
|
|
|
+ </if>
|
|
|
+ order by a.create_time desc
|
|
|
+ <if test="page_sql !=null">
|
|
|
+ ${page_sql}
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+
|
|
|
+ <select id="selectInvestCount" resultType="integer">
|
|
|
+ select count(*)
|
|
|
+ from amb_invest a
|
|
|
+ where 1=1
|
|
|
+ <if test="roleType==1">
|
|
|
+ and a.status in (1,2,3)
|
|
|
+ </if>
|
|
|
+ </select>
|
|
|
+</mapper>
|