UserRechargeMapper.xml 4.78 KB
Newer Older
1 2 3
<?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">

licc's avatar
licc committed
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
<mapper namespace="cn.wisenergy.mapper.UserRechargeMapper">
    <resultMap id="userMap" type="cn.wisenergy.model.app.UserRecharge">
        <id column="id" property="id"/>
        <result column="user_id" property="userId"/>
        <result column="currency_id" property="currencyId"/>
        <result column="name" property="name"/>
        <result column="type" property="type"/>
        <result column="receive_addr" property="receiveAddr"/>
        <result column="from_addr" property="fromAddr"/>
        <result column="amount" property="amount"/>
        <result column="hash" property="hash"/>
        <result column="detail" property="detail"/>
        <result column="payer" property="payer"/>
        <result column="bank_name" property="bankName"/>
        <result column="bank_real_name" property="bankRealName"/>
        <result column="bank_card" property="bankCard"/>
        <result column="method" property="method"/>
        <result column="operate" property="operate"/>
        <result column="operate_at" property="operateAt"/>
        <result column="note" property="note"/>
        <result column="status" property="status"/>
        <result column="created_at" property="createdAt"/>
        <result column="updated_at" property="updatedAt"/>
27 28
    </resultMap>

licc's avatar
licc committed
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 88 89 90 91 92 93 94 95
    <sql id="table">
        user_recharge
    </sql>

    <sql id="cols_all">
        id,
        <include refid="cols_exclude_id"/>
    </sql>

    <sql id="cols_exclude_id">
     user_id, currency_id, `name`, `type`, receive_addr, from_addr, amount, hash, detail, payer, bank_name,
     bank_real_name, bank_card, method, operate, operate_at, note, status, created_at, updated_at
    </sql>

    <sql id="vals">
        #{userId},#{currencyId},#{name},#{type},#{receiveAddr},#{fromAddr},#{amount},#{hash},#{detail},#{payer},
        #{bankName},#{bankRealName},#{bankCard},#{method},#{operate},#{operateAt},#{note},#{status},now(),now()
    </sql>

    <sql id="updateCondition">
        <if test="userId != null">user_id = #{userId},</if>
        <if test="currencyId != null">currency_id =#{currencyId},</if>
        <if test="name != null">`name` =#{name},</if>
        <if test="type != null">`type` =#{type},</if>
        <if test="receiveAddr != null">receive_addr =#{receiveAddr},</if>
        <if test="fromAddr != null">from_addr = #{fromAddr},</if>
        <if test="amount != null">amount =#{amount},</if>
        <if test="hash != null">hash =#{hash},</if>
        <if test="detail != null">detail =#{detail},</if>
        <if test="payer != null">payer = #{payer},</if>
        <if test="token != null">token = #{token},</if>
        <if test="hash != null">hash =#{hash},</if>
        <if test="bankName != null">bank_name =#{bankName},</if>
        <if test="bankRealName != null">bank_real_name =#{bankRealName},</if>
        <if test="bankCard != null">bank_card =#{bankCard},</if>
        <if test="method != null">method = #{method},</if>
        <if test="operate != null">operate =#{operate},</if>
        <if test="operateAt != null">operate_at =#{operateAt},</if>
        <if test="note != null">note =#{note},</if>
        <if test="status != null">status = #{status},</if>
        update_time =now()
    </sql>

    <sql id="criteria">
        <if test="id != null">id = #{id}</if>
        <if test="userId != null">and user_id = #{userId}</if>
        <if test="currencyId != null">and currency_id =#{currencyId}</if>
        <if test="name != null">and `name` =#{name}</if>
        <if test="type != null">and `type` =#{type}</if>
        <if test="receiveAddr != null">and receive_addr =#{receiveAddr}</if>
        <if test="fromAddr != null">and from_addr = #{fromAddr}</if>
        <if test="amount != null">and amount =#{amount}</if>
        <if test="hash != null">and hash =#{hash}</if>
        <if test="detail != null">and detail =#{detail}</if>
        <if test="payer != null">and payer = #{payer}</if>
        <if test="token != null">and token = #{token}</if>
        <if test="hash != null">and hash =#{hash}</if>
        <if test="bankName != null">and bank_name =#{bankName}</if>
        <if test="bankRealName != null">and bank_real_name =#{bankRealName}</if>
        <if test="bankCard != null">and bank_card =#{bankCard}</if>
        <if test="method != null">and method = #{method}</if>
        <if test="operate != null">and operate =#{operate}</if>
        <if test="operateAt != null">and operate_at =#{operateAt}</if>
        <if test="note != null">and note =#{note}</if>
        <if test="status != null">and status = #{status}</if>
        <if test="createdAt != null">and created_at &gt;= #{createdAt}</if>
        <if test="updatedAt != null">and #{updatedAt} &gt;= updated_at</if>
96 97 98
    </sql>

</mapper>