IotUserMapper.xml
3.8 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
<?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.ruoyi.system.mapper.IotUserMapper">
<resultMap type="IotUser" id="IotUserResult">
<result property="create_time" column="create_time" />
<result property="encryption_type" column="encryption_type" />
<result property="id" column="id" />
<result property="open_encryption" column="open_encryption" />
<result property="password" column="password" />
<result property="role_id" column="role_id" />
<result property="salt" column="salt" />
<result property="used" column="used" />
<result property="username" column="username" />
</resultMap>
<sql id="selectIotUserVo">
select create_time, encryption_type, id, open_encryption, password, role_id, salt, used, username from iot_user
</sql>
<select id="selectIotUserList" parameterType="IotUser" resultMap="IotUserResult">
<include refid="selectIotUserVo"/>
<where>
</where>
</select>
<select id="selectIotUserById" parameterType="Integer" resultMap="IotUserResult">
<include refid="selectIotUserVo"/>
where id = #{id}
</select>
<insert id="insertIotUser" parameterType="IotUser" useGeneratedKeys="true" keyProperty="id">
insert into iot_user
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="create_time != null">create_time,</if>
<if test="encryption_type != null">encryption_type,</if>
<if test="open_encryption != null">open_encryption,</if>
<if test="password != null and password != ''">password,</if>
<if test="role_id != null">role_id,</if>
<if test="salt != null">salt,</if>
<if test="used != null">used,</if>
<if test="username != null and username != ''">username,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="create_time != null">#{create_time},</if>
<if test="encryption_type != null">#{encryption_type},</if>
<if test="open_encryption != null">#{open_encryption},</if>
<if test="password != null and password != ''">#{password},</if>
<if test="role_id != null">#{role_id},</if>
<if test="salt != null">#{salt},</if>
<if test="used != null">#{used},</if>
<if test="username != null and username != ''">#{username},</if>
</trim>
</insert>
<update id="updateIotUser" parameterType="IotUser">
update iot_user
<trim prefix="SET" suffixOverrides=",">
<if test="create_time != null">create_time = #{create_time},</if>
<if test="encryption_type != null">encryption_type = #{encryption_type},</if>
<if test="open_encryption != null">open_encryption = #{open_encryption},</if>
<if test="password != null and password != ''">password = #{password},</if>
<if test="role_id != null">role_id = #{role_id},</if>
<if test="salt != null">salt = #{salt},</if>
<if test="used != null">used = #{used},</if>
<if test="username != null and username != ''">username = #{username},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteIotUserById" parameterType="Integer">
delete from iot_user where id = #{id}
</delete>
<delete id="deleteIotUserByIds" parameterType="String">
delete from iot_user where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>