Administrator
2024-08-03 d38bb7f88d0c499265e6da62a52686a654834daa
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
<?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.dy.pipIrrGlobal.daoSe.SeVcRechargeMapper">
  <resultMap id="BaseResultMap" type="com.dy.pipIrrGlobal.pojoSe.SeVcRecharge">
    <!--@mbg.generated-->
    <!--@Table se_vc_recharge-->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="vc_id" jdbcType="BIGINT" property="vcId" />
    <result column="client_id" jdbcType="BIGINT" property="clientId" />
    <result column="money" jdbcType="FLOAT" property="money" />
    <result column="after_recharge" jdbcType="FLOAT" property="afterRecharge" />
    <result column="order_number" jdbcType="VARCHAR" property="orderNumber" />
    <result column="recharge_amount" jdbcType="INTEGER" property="rechargeAmount" />
    <result column="order_time" jdbcType="TIMESTAMP" property="orderTime" />
    <result column="recharge_time" jdbcType="TIMESTAMP" property="rechargeTime" />
    <result column="order_state" jdbcType="TINYINT" property="orderState" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--@mbg.generated-->
    id, vc_id, client_id, money, after_recharge, order_number, recharge_amount, order_time, 
    recharge_time, order_state
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--@mbg.generated-->
    select 
    <include refid="Base_Column_List" />
    from se_vc_recharge
    where id = #{id,jdbcType=BIGINT}
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--@mbg.generated-->
    delete from se_vc_recharge
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.dy.pipIrrGlobal.pojoSe.SeVcRecharge">
    <!--@mbg.generated-->
    insert into se_vc_recharge (id, vc_id, client_id, 
      money, after_recharge, order_number, 
      recharge_amount, order_time, recharge_time, 
      order_state)
    values (#{id,jdbcType=BIGINT}, #{vcId,jdbcType=BIGINT}, #{clientId,jdbcType=BIGINT}, 
      #{money,jdbcType=FLOAT}, #{afterRecharge,jdbcType=FLOAT}, #{orderNumber,jdbcType=VARCHAR}, 
      #{rechargeAmount,jdbcType=INTEGER}, #{orderTime,jdbcType=TIMESTAMP}, #{rechargeTime,jdbcType=TIMESTAMP}, 
      #{orderState,jdbcType=TINYINT})
  </insert>
  <insert id="insertSelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeVcRecharge">
    <!--@mbg.generated-->
    insert into se_vc_recharge
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="id != null">
        id,
      </if>
      <if test="vcId != null">
        vc_id,
      </if>
      <if test="clientId != null">
        client_id,
      </if>
      <if test="money != null">
        money,
      </if>
      <if test="afterRecharge != null">
        after_recharge,
      </if>
      <if test="orderNumber != null">
        order_number,
      </if>
      <if test="rechargeAmount != null">
        recharge_amount,
      </if>
      <if test="orderTime != null">
        order_time,
      </if>
      <if test="rechargeTime != null">
        recharge_time,
      </if>
      <if test="orderState != null">
        order_state,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="id != null">
        #{id,jdbcType=BIGINT},
      </if>
      <if test="vcId != null">
        #{vcId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        #{money,jdbcType=FLOAT},
      </if>
      <if test="afterRecharge != null">
        #{afterRecharge,jdbcType=FLOAT},
      </if>
      <if test="orderNumber != null">
        #{orderNumber,jdbcType=VARCHAR},
      </if>
      <if test="rechargeAmount != null">
        #{rechargeAmount,jdbcType=INTEGER},
      </if>
      <if test="orderTime != null">
        #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="rechargeTime != null">
        #{rechargeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderState != null">
        #{orderState,jdbcType=TINYINT},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.dy.pipIrrGlobal.pojoSe.SeVcRecharge">
    <!--@mbg.generated-->
    update se_vc_recharge
    <set>
      <if test="vcId != null">
        vc_id = #{vcId,jdbcType=BIGINT},
      </if>
      <if test="clientId != null">
        client_id = #{clientId,jdbcType=BIGINT},
      </if>
      <if test="money != null">
        money = #{money,jdbcType=FLOAT},
      </if>
      <if test="afterRecharge != null">
        after_recharge = #{afterRecharge,jdbcType=FLOAT},
      </if>
      <if test="orderNumber != null">
        order_number = #{orderNumber,jdbcType=VARCHAR},
      </if>
      <if test="rechargeAmount != null">
        recharge_amount = #{rechargeAmount,jdbcType=INTEGER},
      </if>
      <if test="orderTime != null">
        order_time = #{orderTime,jdbcType=TIMESTAMP},
      </if>
      <if test="rechargeTime != null">
        recharge_time = #{rechargeTime,jdbcType=TIMESTAMP},
      </if>
      <if test="orderState != null">
        order_state = #{orderState,jdbcType=TINYINT},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.dy.pipIrrGlobal.pojoSe.SeVcRecharge">
    <!--@mbg.generated-->
    update se_vc_recharge
    set vc_id = #{vcId,jdbcType=BIGINT},
      client_id = #{clientId,jdbcType=BIGINT},
      money = #{money,jdbcType=FLOAT},
      after_recharge = #{afterRecharge,jdbcType=FLOAT},
      order_number = #{orderNumber,jdbcType=VARCHAR},
      recharge_amount = #{rechargeAmount,jdbcType=INTEGER},
      order_time = #{orderTime,jdbcType=TIMESTAMP},
      recharge_time = #{rechargeTime,jdbcType=TIMESTAMP},
      order_state = #{orderState,jdbcType=TINYINT}
    where id = #{id,jdbcType=BIGINT}
  </update>
 
  <!--根据订单号获取虚拟卡充值对象-->
  <select id="getVCRechargeByorderNumber" resultMap="BaseResultMap">
    SELECT
        <include refid="Base_Column_List" />
    FROM se_vc_recharge
    WHERE order_number = #{orderNumber}
    LIMIT 0,1
  </select>
 
  <!--根据虚拟卡号获取订单列表-->
  <select id="getOrders" resultType="com.dy.pipIrrGlobal.voSe.VoOrders">
    SELECT
      order_number AS orderNumber,
      recharge_amount AS rechargeAmount,
      recharge_time AS rechargeTime
    FROM se_vc_recharge
    <where>
      AND order_state = 2
      <if test = "virtualId != null and virtualId > 0">
        AND vc_id = ${virtualId}
      </if>
    </where>
    ORDER BY order_number
  </select>
 
<!--根据订单号获取充值金额-->
  <select id="getRechargeAmountByOrderNumber" resultType="java.lang.Integer">
    SELECT
        recharge_amount AS rechargeAmount
    FROM se_vc_recharge
    <where>
      <if test = "orderNumber != null and orderNumber !=''">
        AND order_number = #{orderNumber}
      </if>
    </where>
  </select>
</mapper>