Air
2024-11-04 ef8463bc78e8e3f6b6ca3f8a76bb72d000a04ff2
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
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<?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.nova.sankuai.infra.mapper.AlipayRefundRecordMapper">
  <resultMap id="BaseResultMap" type="com.nova.sankuai.domain.entity.AlipayRefundRecord">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <id column="id" jdbcType="BIGINT" property="id" />
    <result column="refund_username" jdbcType="VARCHAR" property="refundUsername" />
    <result column="refund_reason" jdbcType="VARCHAR" property="refundReason"
            typeHandler="com.nova.sankuai.domain.enums.alipayrefund.RefundReasonTypeHandler" />
    <result column="refund_amount" jdbcType="DECIMAL" property="refundAmount" />
    <result column="refund_account" jdbcType="VARCHAR" property="refundAccount" />
    <result column="refund_req_time" jdbcType="TIMESTAMP" property="refundReqTime" />
    <result column="refund_status" jdbcType="TINYINT" property="refundStatus"
            typeHandler="com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler" />
    <result column="deal_desc" jdbcType="VARCHAR" property="dealDesc" />
    <result column="deal_time" jdbcType="TIMESTAMP" property="dealTime" />
    <result column="deal_user_id" jdbcType="VARCHAR" property="dealUserId" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    id, refund_username, refund_reason, refund_amount, refund_account, refund_req_time, refund_status,
    deal_desc, deal_time, deal_user_id
  </sql>
  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    select 
    <include refid="Base_Column_List" />
    from alipay_refund_record
    where id = #{id,jdbcType=BIGINT}
  </select>
  <select id="selectPage" resultMap="BaseResultMap">
    select
    <include refid="Base_Column_List" />
    from alipay_refund_record
    <where>
      <if test="param.refundStatus != null">
        and refund_status = #{param.refundStatus,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler}
      </if>
      <if test="param.alipayAccount != null">
        and refund_account = #{param.alipayAccount}
      </if>
      <choose>
        <when test="param.from != null and param.to != null">
          and refund_req_time between #{param.from} and #{param.to}
        </when>
        <when test="param.from != null">
          and refund_req_time &gt;= #{param.from}
        </when>
        <when test="param.to != null">
          and refund_req_time &lt;= #{param.to}
        </when>
        <otherwise/>
      </choose>
    </where>
    order by refund_req_time desc
  </select>
  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    delete from alipay_refund_record
    where id = #{id,jdbcType=BIGINT}
  </delete>
  <insert id="insert" parameterType="com.nova.sankuai.domain.entity.AlipayRefundRecord">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into alipay_refund_record (refund_username, refund_reason, refund_amount, refund_account,
      refund_req_time, refund_status, deal_desc, 
      deal_time, deal_user_id)
    values (#{refundUsername,jdbcType=VARCHAR},
      #{refundReason,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundReasonTypeHandler},
      #{refundAmount,jdbcType=DECIMAL}, #{refundAccount,jdbcType=VARCHAR},
      #{refundReqTime,jdbcType=TIMESTAMP}, #{refundStatus,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler}, #{dealDesc,jdbcType=VARCHAR},
      #{dealTime,jdbcType=TIMESTAMP}, #{dealUserId,jdbcType=VARCHAR})
  </insert>
  <insert id="insertSelective" parameterType="com.nova.sankuai.domain.entity.AlipayRefundRecord">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
      SELECT LAST_INSERT_ID()
    </selectKey>
    insert into alipay_refund_record
    <trim prefix="(" suffix=")" suffixOverrides=",">
      <if test="refundUsername != null">
        refund_username,
      </if>
      <if test="refundReason != null">
        refund_reason,
      </if>
      <if test="refundAmount != null">
        refund_amount,
      </if>
      <if test="refundAccount != null">
        refund_account,
      </if>
      <if test="refundReqTime != null">
        refund_req_time,
      </if>
      <if test="refundStatus != null">
        refund_status,
      </if>
      <if test="dealDesc != null">
        deal_desc,
      </if>
      <if test="dealTime != null">
        deal_time,
      </if>
      <if test="dealUserId != null">
        deal_user_id,
      </if>
    </trim>
    <trim prefix="values (" suffix=")" suffixOverrides=",">
      <if test="refundUsername != null">
        #{refundUsername,jdbcType=VARCHAR},
      </if>
      <if test="refundReason != null">
        #{refundReason,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundReasonTypeHandler},
      </if>
      <if test="refundAmount != null">
        #{refundAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundAccount != null">
        #{refundAccount,jdbcType=VARCHAR},
      </if>
      <if test="refundReqTime != null">
        #{refundReqTime,jdbcType=TIMESTAMP},
      </if>
      <if test="refundStatus != null">
        #{refundReason,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler},
      </if>
      <if test="dealDesc != null">
        #{dealDesc,jdbcType=VARCHAR},
      </if>
      <if test="dealTime != null">
        #{dealTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dealUserId != null">
        #{dealUserId,jdbcType=VARCHAR},
      </if>
    </trim>
  </insert>
  <update id="updateByPrimaryKeySelective" parameterType="com.nova.sankuai.domain.entity.AlipayRefundRecord">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update alipay_refund_record
    <set>
      <if test="refundUsername != null">
        refund_username = #{refundUsername,jdbcType=VARCHAR},
      </if>
      <if test="refundReason != null">
        refund_reason = #{refundReason,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundReasonTypeHandler},
      </if>
      <if test="refundAmount != null">
        refund_amount = #{refundAmount,jdbcType=DECIMAL},
      </if>
      <if test="refundAccount != null">
        refund_account = #{refundAccount,jdbcType=VARCHAR},
      </if>
      <if test="refundReqTime != null">
        refund_req_time = #{refundReqTime,jdbcType=TIMESTAMP},
      </if>
      <if test="refundStatus != null">
        refund_status = #{refundStatus,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler},
      </if>
      <if test="dealDesc != null">
        deal_desc = #{dealDesc,jdbcType=VARCHAR},
      </if>
      <if test="dealTime != null">
        deal_time = #{dealTime,jdbcType=TIMESTAMP},
      </if>
      <if test="dealUserId != null">
        deal_user_id = #{dealUserId,jdbcType=VARCHAR},
      </if>
    </set>
    where id = #{id,jdbcType=BIGINT}
  </update>
  <update id="updateByPrimaryKey" parameterType="com.nova.sankuai.domain.entity.AlipayRefundRecord">
    <!--
      WARNING - @mbg.generated
      This element is automatically generated by MyBatis Generator, do not modify.
    -->
    update alipay_refund_record
    set refund_username = #{refundUsername,jdbcType=VARCHAR},
      refund_reason = #{refundReason,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundReasonTypeHandler},
      refund_amount = #{refundAmount,jdbcType=DECIMAL},
      refund_account = #{refundAccount,jdbcType=VARCHAR},
      refund_req_time = #{refundReqTime,jdbcType=TIMESTAMP},
      refund_status = #{refundStatus,typeHandler=com.nova.sankuai.domain.enums.alipayrefund.RefundStatusTypeHandler},
      deal_desc = #{dealDesc,jdbcType=VARCHAR},
      deal_time = #{dealTime,jdbcType=TIMESTAMP},
      deal_user_id = #{dealUserId,jdbcType=VARCHAR}
    where id = #{id,jdbcType=BIGINT}
  </update>
</mapper>