MonitorValueMapper.xml
3.73 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
<?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.web.controller.business.mapper.MonitorValueMapper">
<resultMap type="MonitorValue" id="MonitorValueResult">
<result property="type" column="type" />
<result property="field" column="field" />
<result property="meaning" column="meaning" />
<result property="status" column="status" />
<result property="sort" column="sort" />
</resultMap>
<resultMap type="MonitorValue" id="MonitorValueMap">
<result property="field" column="field" />
<result property="meaning" column="meaning" />
</resultMap>
<sql id="selectMonitorValueVo">
select type, field, meaning, status, sort from monitor_value
</sql>
<select id="selectMonitorValueList" parameterType="MonitorValue" resultMap="MonitorValueResult">
<include refid="selectMonitorValueVo"/>
<where>
<if test="type != null and type != '' "> and type = #{type}</if>
<if test="field != null and field != '' "> and field = #{field}</if>
<if test="meaning != null and meaning != '' "> and meaning = #{meaning}</if>
<if test="status != null and status != '' "> and status = #{status}</if>
<if test="sort != null "> and sort = #{sort}</if>
</where>
</select>
<select id="selectMonitorValueById" parameterType="String" resultMap="MonitorValueResult">
<include refid="selectMonitorValueVo"/>
where type = #{type}
</select>
<insert id="insertMonitorValue" parameterType="MonitorValue">
insert into monitor_value
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null and type != '' ">type,</if>
<if test="field != null and field != '' ">field,</if>
<if test="meaning != null and meaning != '' ">meaning,</if>
<if test="status != null and status != '' ">status,</if>
<if test="sort != null ">sort,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null and type != '' ">#{type},</if>
<if test="field != null and field != '' ">#{field},</if>
<if test="meaning != null and meaning != '' ">#{meaning},</if>
<if test="status != null and status != '' ">#{status},</if>
<if test="sort != null ">#{sort},</if>
</trim>
</insert>
<update id="updateMonitorValue" parameterType="MonitorValue">
update monitor_value
<trim prefix="SET" suffixOverrides=",">
<if test="field != null and field != '' ">field = #{field},</if>
<if test="meaning != null and meaning != '' ">meaning = #{meaning},</if>
<if test="status != null and status != '' ">status = #{status},</if>
<if test="sort != null ">sort = #{sort},</if>
</trim>
where type = #{type}
</update>
<delete id="deleteMonitorValueById" parameterType="String">
delete from monitor_value where type = #{type}
</delete>
<delete id="deleteMonitorValueByIds" parameterType="String">
delete from monitor_value where type in
<foreach item="type" collection="array" open="(" separator="," close=")">
#{type}
</foreach>
</delete>
<select id="queryMonitorValueList" parameterType="MonitorValue" resultType="Map">
select field,meaning from monitor_value
<where>
<if test="type != null and type != '' "> and type = #{type}</if>
<if test="status != null and status != '' "> and status = #{status}</if>
</where>
order by sort
</select>
</mapper>