| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?xml version="1.0" encoding="UTF-8"?>
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.goafanti.common.dao.AmbInvestMapper">
- <resultMap id="BaseResultMap" type="com.goafanti.common.model.AmbInvest">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="initiate_amb_id" jdbcType="BIGINT" property="initiateAmbId" />
- <result column="accept_amb_id" jdbcType="BIGINT" property="acceptAmbId" />
- <result column="amount" jdbcType="DECIMAL" property="amount" />
- <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" />
- <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,
- count_amount
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from amb_invest
- where id = #{id,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
- delete from amb_invest
- 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`,
- 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}, #{countAmount,jdbcType=DECIMAL})
- </insert>
- <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.goafanti.common.model.AmbInvest" useGeneratedKeys="true">
- insert into amb_invest
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="initiateAmbId != null">
- initiate_amb_id,
- </if>
- <if test="acceptAmbId != null">
- accept_amb_id,
- </if>
- <if test="amount != null">
- amount,
- </if>
- <if test="status != null">
- `status`,
- </if>
- <if test="operator != null">
- `operator`,
- </if>
- <if test="comment != null">
- `comment`,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="countAmount != null">
- count_amount,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="initiateAmbId != null">
- #{initiateAmbId,jdbcType=BIGINT},
- </if>
- <if test="acceptAmbId != null">
- #{acceptAmbId,jdbcType=BIGINT},
- </if>
- <if test="amount != null">
- #{amount,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- #{status,jdbcType=INTEGER},
- </if>
- <if test="operator != null">
- #{operator,jdbcType=VARCHAR},
- </if>
- <if test="comment != null">
- #{comment,jdbcType=VARCHAR},
- </if>
- <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">
- update amb_invest
- <set>
- <if test="initiateAmbId != null">
- initiate_amb_id = #{initiateAmbId,jdbcType=BIGINT},
- </if>
- <if test="acceptAmbId != null">
- accept_amb_id = #{acceptAmbId,jdbcType=BIGINT},
- </if>
- <if test="amount != null">
- amount = #{amount,jdbcType=DECIMAL},
- </if>
- <if test="status != null">
- `status` = #{status,jdbcType=INTEGER},
- </if>
- <if test="operator != null">
- `operator` = #{operator,jdbcType=VARCHAR},
- </if>
- <if test="comment != null">
- `comment` = #{comment,jdbcType=VARCHAR},
- </if>
- <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>
- <update id="updateByPrimaryKey" parameterType="com.goafanti.common.model.AmbInvest">
- update amb_invest
- set initiate_amb_id = #{initiateAmbId,jdbcType=BIGINT},
- accept_amb_id = #{acceptAmbId,jdbcType=BIGINT},
- amount = #{amount,jdbcType=DECIMAL},
- `status` = #{status,jdbcType=INTEGER},
- `operator` = #{operator,jdbcType=VARCHAR},
- `comment` = #{comment,jdbcType=VARCHAR},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- count_amount = #{countAmount,jdbcType=DECIMAL}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <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>
- <select id="selectCountAmountById" resultType="java.lang.Integer">
- select sum(amount)amount
- from amb_invest
- where status=2 and accept_amb_id = #{id}
- </select>
- <select id="selectAmbInvestDtailsList" resultType="com.goafanti.ambSystem.bo.OutInvestList">
- select a.id,a.initiate_amb_id initiateAmbId ,a.accept_amb_id acceptAmbId,a.amount ,a.status ,
- a.comment , date_format(a.create_time,'%Y-%m-%d %H:%i:%S') createTimes,
- b.name initiateName,c.name acceptName,d.name operator
- 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 a.status =2
- <if test="type==0">
- and a.initiate_amb_id= #{id}
- </if>
- <if test="type==1">
- and a.accept_amb_id = #{id}
- </if>
- order by a.create_time desc
- </select>
- </mapper>
|