IotThingsModelTemplateMapper.xml
7.5 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
<?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.IotThingsModelTemplateMapper">
<resultMap type="IotThingsModelTemplate" id="IotThingsModelTemplateResult">
<result property="ascription" column="ascription" />
<result property="config_names" column="config_names" />
<result property="create_by" column="create_by" />
<result property="create_time" column="create_time" />
<result property="data_type" column="data_type" />
<result property="del_flag" column="del_flag" />
<result property="identifier" column="identifier" />
<result property="is_config" column="is_config" />
<result property="is_monitor" column="is_monitor" />
<result property="is_save_log" column="is_save_log" />
<result property="is_top" column="is_top" />
<result property="model_id" column="model_id" />
<result property="model_name" column="model_name" />
<result property="mqtt_username" column="mqtt_username" />
<result property="product_id" column="product_id" />
<result property="remark" column="remark" />
<result property="specs" column="specs" />
<result property="type" column="type" />
<result property="update_by" column="update_by" />
<result property="update_time" column="update_time" />
<result property="view_type" column="view_type" />
</resultMap>
<sql id="selectIotThingsModelTemplateVo">
select `ascription`, `config_names`, `create_by`, `create_time`, `data_type`, `del_flag`, `identifier`, `is_config`, `is_monitor`, `is_save_log`, `is_top`, `model_id`, `model_name`, `mqtt_username`, `product_id`, `remark`, `specs`, `type`, `update_by`, `update_time`, `view_type` from iot_things_model_template
</sql>
<select id="selectIotThingsModelTemplateList" parameterType="IotThingsModelTemplate" resultMap="IotThingsModelTemplateResult">
<include refid="selectIotThingsModelTemplateVo"/>
<where>
</where>
</select>
<select id="selectIotThingsModelTemplateByModel_id" parameterType="Integer" resultMap="IotThingsModelTemplateResult">
<include refid="selectIotThingsModelTemplateVo"/>
where model_id = #{model_id}
</select>
<insert id="insertIotThingsModelTemplate" parameterType="IotThingsModelTemplate" useGeneratedKeys="true" keyProperty="model_id">
insert into iot_things_model_template
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="ascription != null">ascription,</if>
<if test="config_names != null">config_names,</if>
<if test="create_by != null">create_by,</if>
<if test="create_time != null">create_time,</if>
<if test="data_type != null and data_type != ''">data_type,</if>
<if test="del_flag != null">del_flag,</if>
<if test="identifier != null and identifier != ''">identifier,</if>
<if test="is_config != null">is_config,</if>
<if test="is_monitor != null">is_monitor,</if>
<if test="is_save_log != null">is_save_log,</if>
<if test="is_top != null">is_top,</if>
<if test="model_name != null and model_name != ''">model_name,</if>
<if test="mqtt_username != null and mqtt_username != ''">mqtt_username,</if>
<if test="product_id != null">product_id,</if>
<if test="remark != null">remark,</if>
<if test="specs != null">specs,</if>
<if test="type != null">type,</if>
<if test="update_by != null">update_by,</if>
<if test="update_time != null">update_time,</if>
<if test="view_type != null">view_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="ascription != null">#{ascription},</if>
<if test="config_names != null">#{config_names},</if>
<if test="create_by != null">#{create_by},</if>
<if test="create_time != null">#{create_time},</if>
<if test="data_type != null and data_type != ''">#{data_type},</if>
<if test="del_flag != null">#{del_flag},</if>
<if test="identifier != null and identifier != ''">#{identifier},</if>
<if test="is_config != null">#{is_config},</if>
<if test="is_monitor != null">#{is_monitor},</if>
<if test="is_save_log != null">#{is_save_log},</if>
<if test="is_top != null">#{is_top},</if>
<if test="model_name != null and model_name != ''">#{model_name},</if>
<if test="mqtt_username != null and mqtt_username != ''">#{mqtt_username},</if>
<if test="product_id != null">#{product_id},</if>
<if test="remark != null">#{remark},</if>
<if test="specs != null">#{specs},</if>
<if test="type != null">#{type},</if>
<if test="update_by != null">#{update_by},</if>
<if test="update_time != null">#{update_time},</if>
<if test="view_type != null">#{view_type},</if>
</trim>
</insert>
<update id="updateIotThingsModelTemplate" parameterType="IotThingsModelTemplate">
update iot_things_model_template
<trim prefix="SET" suffixOverrides=",">
<if test="ascription != null">ascription = #{ascription},</if>
<if test="config_names != null">config_names = #{config_names},</if>
<if test="create_by != null">create_by = #{create_by},</if>
<if test="create_time != null">create_time = #{create_time},</if>
<if test="data_type != null and data_type != ''">data_type = #{data_type},</if>
<if test="del_flag != null">del_flag = #{del_flag},</if>
<if test="identifier != null and identifier != ''">identifier = #{identifier},</if>
<if test="is_config != null">is_config = #{is_config},</if>
<if test="is_monitor != null">is_monitor = #{is_monitor},</if>
<if test="is_save_log != null">is_save_log = #{is_save_log},</if>
<if test="is_top != null">is_top = #{is_top},</if>
<if test="model_name != null and model_name != ''">model_name = #{model_name},</if>
<if test="mqtt_username != null and mqtt_username != ''">mqtt_username = #{mqtt_username},</if>
<if test="product_id != null">product_id = #{product_id},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="specs != null">specs = #{specs},</if>
<if test="type != null">`type` = #{type},</if>
<if test="update_by != null">update_by = #{update_by},</if>
<if test="update_time != null">update_time = #{update_time},</if>
<if test="view_type != null">view_type = #{view_type},</if>
</trim>
where model_id = #{model_id}
</update>
<delete id="deleteIotThingsModelTemplateByModel_id" parameterType="Integer">
delete from iot_things_model_template where model_id = #{model_id}
</delete>
<delete id="deleteIotThingsModelTemplateByModel_ids" parameterType="String">
delete from iot_things_model_template where model_id in
<foreach item="model_id" collection="array" open="(" separator="," close=")">
#{model_id}
</foreach>
</delete>
</mapper>