yujian
2019-01-22 88b54772dbcf5ecab1e2316e4e4626ac901b8908
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?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.yeshi.fanli.dao.mybatis.MoneyRecordMapper">
    <resultMap id="BaseResultMap" type="com.yeshi.fanli.entity.bus.user.MoneyRecord">
        <id column="id" property="id" jdbcType="BIGINT" />
        <result column="money" property="money" jdbcType="DECIMAL" />
        <result column="title" property="title" jdbcType="VARCHAR" />
        <result column="remark" property="remark" jdbcType="VARCHAR" />
        <result column="createtime" property="createtime" jdbcType="BIGINT" />
        <result column="type" property="type" jdbcType="INTEGER" />
        <!-- <association property="userInfo" column="uid" resultMap="com.yeshi.fanli.entity.dao.mybatis.UserInfoMapper.BaseResultMap"/> 
            <association property="hongBao" column="hid" resultMap="com.yeshi.fanli.entity.dao.mybatis.HongBaoMapper.BaseResultMap"/> 
            <association property="extract" column="eid" resultMap="com.yeshi.fanli.entity.dao.mybatis.ExtractMapper.BaseResultMap"/> -->
    </resultMap>
    <sql id="Base_Column_List">id,uid,hid,money,title,remark,createtime,type,eid</sql>
    <select id="selectByPrimaryKey" resultMap="BaseResultMap"
        parameterType="java.lang.Long">
        select
        <include refid="Base_Column_List" />
        from yeshi_ec_money_record where id = #{id,jdbcType=BIGINT}
    </select>
    <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">delete from
        yeshi_ec_money_record where id = #{id,jdbcType=BIGINT}
    </delete>
 
    <delete id="deleteMoneyRecordByExtractId" parameterType="java.lang.Long">delete
        from
        yeshi_ec_money_record where eid = #{0}
    </delete>
 
 
    <insert id="insert" parameterType="com.yeshi.fanli.entity.bus.user.MoneyRecord"
        useGeneratedKeys="true" keyProperty="id">insert into yeshi_ec_money_record
        (id,uid,hid,money,title,remark,createtime,type,eid) values
        (#{id,jdbcType=BIGINT},#{userInfo.id,jdbcType=BIGINT},#{hongBao.id,jdbcType=BIGINT},#{money,jdbcType=DECIMAL},#{title,jdbcType=VARCHAR},#{remark,jdbcType=VARCHAR},#{createtime,jdbcType=BIGINT},#{type,jdbcType=INTEGER},#{extract.id,jdbcType=BIGINT})
    </insert>
    <insert id="insertSelective" parameterType="com.yeshi.fanli.entity.bus.user.MoneyRecord"
        useGeneratedKeys="true" keyProperty="id">
        insert into yeshi_ec_money_record
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">id,</if>
            <if test="userInfo != null">uid,</if>
            <if test="hongBao != null">hid,</if>
            <if test="money != null">money,</if>
            <if test="title != null">title,</if>
            <if test="remark != null">remark,</if>
            <if test="createtime != null">createtime,</if>
            <if test="type != null">type,</if>
            <if test="extract != null">eid,</if>
        </trim>
        values
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="id != null">#{id,jdbcType=BIGINT},</if>
            <if test="userInfo != null">#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="hongBao != null">#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="money != null">#{money,jdbcType=DECIMAL},</if>
            <if test="title != null">#{title,jdbcType=VARCHAR},</if>
            <if test="remark != null">#{remark,jdbcType=VARCHAR},</if>
            <if test="createtime != null">#{createtime,jdbcType=BIGINT},</if>
            <if test="type != null">#{type,jdbcType=INTEGER},</if>
            <if test="extract != null">#{extract.id,jdbcType=BIGINT},</if>
        </trim>
    </insert>
    <update id="updateByPrimaryKey" parameterType="com.yeshi.fanli.entity.bus.user.MoneyRecord">update
        yeshi_ec_money_record set uid = #{userInfo.id,jdbcType=BIGINT},hid =
        #{hongBao.id,jdbcType=BIGINT},money = #{money,jdbcType=DECIMAL},title
        = #{title,jdbcType=VARCHAR},remark =
        #{remark,jdbcType=VARCHAR},createtime =
        #{createtime,jdbcType=BIGINT},type = #{type,jdbcType=INTEGER},eid =
        #{extract.id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
    </update>
    <update id="updateByPrimaryKeySelective" parameterType="com.yeshi.fanli.entity.bus.user.MoneyRecord">
        update yeshi_ec_money_record
        <set>
            <if test="userInfo != null">uid=#{userInfo.id,jdbcType=BIGINT},</if>
            <if test="hongBao != null">hid=#{hongBao.id,jdbcType=BIGINT},</if>
            <if test="money != null">money=#{money,jdbcType=DECIMAL},</if>
            <if test="title != null">title=#{title,jdbcType=VARCHAR},</if>
            <if test="remark != null">remark=#{remark,jdbcType=VARCHAR},</if>
            <if test="createtime != null">createtime=#{createtime,jdbcType=BIGINT},</if>
            <if test="type != null">type=#{type,jdbcType=INTEGER},</if>
            <if test="extract != null">eid=#{extract.id,jdbcType=BIGINT},</if>
        </set>
        where id = #{id,jdbcType=BIGINT}
    </update>
</mapper>