ElectricityInfoMapper.xml
6.7 KB
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
<?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.sunyo.energy.location.dao.ElectricityInfoMapper">
<resultMap id="BaseResultMap" type="com.sunyo.energy.location.model.ElectricityInfo">
<id column="order_number" property="orderNumber" jdbcType="VARCHAR"/>
<result column="action_type" property="actionType" jdbcType="VARCHAR"/>
<result column="device_id" property="deviceId" jdbcType="VARCHAR"/>
<result column="money" property="money" jdbcType="DECIMAL"/>
<result column="ip_address" property="ipAddress" jdbcType="VARCHAR"/>
<result column="secret" property="secret" jdbcType="VARCHAR"/>
<result column="status" property="status" jdbcType="VARCHAR"/>
<result column="opert_time" property="opertTime" jdbcType="TIMESTAMP"/>
<result column="edit_time" property="editTime" jdbcType="TIMESTAMP"/>
<result column="info_status" property="infoStatus" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
order_number, action_type, device_id, money, ip_address, secret, status, opert_time,
edit_time, info_status
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String">
select
<include refid="Base_Column_List"/>
from electricity_info
where order_number = #{orderNumber,jdbcType=VARCHAR}
</select>
<select id="selectAll" resultMap="BaseResultMap" parameterType="string">
select
<include refid="Base_Column_List"/>
from electricity_info
where status = '1'
<if test="deviceId != null and deviceId != ''">
and device_id = #{deviceId, jdbcType=VARCHAR}
</if>
order by opert_time desc
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String">
delete from electricity_info
where order_number = #{orderNumber,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
insert into electricity_info (order_number, action_type, device_id,
money, ip_address, secret,
status, opert_time, edit_time,
info_status)
values (#{orderNumber,jdbcType=VARCHAR}, #{actionType,jdbcType=VARCHAR}, #{deviceId,jdbcType=VARCHAR},
#{money,jdbcType=DECIMAL}, #{ipAddress,jdbcType=VARCHAR}, #{secret,jdbcType=VARCHAR},
#{status,jdbcType=VARCHAR}, #{opertTime,jdbcType=TIMESTAMP}, #{editTime,jdbcType=TIMESTAMP},
#{infoStatus,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
insert into electricity_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="orderNumber != null">
order_number,
</if>
<if test="actionType != null">
action_type,
</if>
<if test="deviceId != null">
device_id,
</if>
<if test="money != null">
money,
</if>
<if test="ipAddress != null">
ip_address,
</if>
<if test="secret != null">
secret,
</if>
<if test="status != null">
status,
</if>
<if test="opertTime != null">
opert_time,
</if>
<if test="editTime != null">
edit_time,
</if>
<if test="infoStatus != null">
info_status,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="orderNumber != null">
#{orderNumber,jdbcType=VARCHAR},
</if>
<if test="actionType != null">
#{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
#{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null">
#{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null">
#{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null">
#{secret,jdbcType=VARCHAR},
</if>
<if test="status != null">
#{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null">
#{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null">
#{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null">
#{infoStatus,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
update electricity_info
<set>
<if test="actionType != null">
action_type = #{actionType,jdbcType=VARCHAR},
</if>
<if test="deviceId != null">
device_id = #{deviceId,jdbcType=VARCHAR},
</if>
<if test="money != null">
money = #{money,jdbcType=DECIMAL},
</if>
<if test="ipAddress != null">
ip_address = #{ipAddress,jdbcType=VARCHAR},
</if>
<if test="secret != null">
secret = #{secret,jdbcType=VARCHAR},
</if>
<if test="status != null">
status = #{status,jdbcType=VARCHAR},
</if>
<if test="opertTime != null">
opert_time = #{opertTime,jdbcType=TIMESTAMP},
</if>
<if test="editTime != null">
edit_time = #{editTime,jdbcType=TIMESTAMP},
</if>
<if test="infoStatus != null">
info_status = #{infoStatus,jdbcType=VARCHAR},
</if>
</set>
where order_number = #{orderNumber,jdbcType=VARCHAR}
</update>
<update id="updateByPrimaryKey" parameterType="com.sunyo.energy.location.model.ElectricityInfo">
update electricity_info
set action_type = #{actionType,jdbcType=VARCHAR},
device_id = #{deviceId,jdbcType=VARCHAR},
money = #{money,jdbcType=DECIMAL},
ip_address = #{ipAddress,jdbcType=VARCHAR},
secret = #{secret,jdbcType=VARCHAR},
status = #{status,jdbcType=VARCHAR},
opert_time = #{opertTime,jdbcType=TIMESTAMP},
edit_time = #{editTime,jdbcType=TIMESTAMP},
info_status = #{infoStatus,jdbcType=VARCHAR}
where order_number = #{orderNumber,jdbcType=VARCHAR}
</update>
</mapper>