admin
2024-10-15 6d313a4a6f9f9d7ea65ec50ab0d4491e595edb97
提交 | 用户 | 时间
e57a89 1 <?xml version="1.0" encoding="UTF-8" ?>
2 <!DOCTYPE mapper
3 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5 <mapper namespace="com.jcdm.main.da.opcuaconfig.mapper.DaOpcuaConfigMapper">
6     <resultMap type="DaOpcuaConfig" id="DaOpcuaConfigResult">
7         <result property="id"    column="id"    />
8         <result property="node"    column="node"    />
9         <result property="sysTypes"    column="sys_types"    />
10         <result property="subscribe"    column="subscribe"    />
11         <result property="rFunction"    column="r_function"    />
12         <result property="remarks"    column="remarks"    />
13         <result property="processName"    column="process_name"    />
14         <result property="process"    column="process"    />
15         <result property="state"    column="state"    />
16     </resultMap>
17
18     <sql id="selectDaOpcuaConfigVo">
19         select id, node, sys_types, subscribe, r_function, remarks, process_name, process, state from da_opcua_config
20     </sql>
21
22     <select id="selectDaOpcuaConfigList" parameterType="DaOpcuaConfig" resultMap="DaOpcuaConfigResult">
23         <include refid="selectDaOpcuaConfigVo"/>
24         <where>  
25             <if test="node != null  and node != ''"> and node = #{node}</if>
26             <if test="rFunction != null  and rFunction != ''"> and r_function = #{rFunction}</if>
27             <if test="process != null  and process != ''"> and process = #{process}</if>
28             <if test="state != null "> and state = #{state}</if>
29         </where>
30     </select>
31     
32     <select id="selectDaOpcuaConfigById" parameterType="Long" resultMap="DaOpcuaConfigResult">
33         <include refid="selectDaOpcuaConfigVo"/>
34         where id = #{id}
35     </select>
36         
37     <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig" useGeneratedKeys="true" keyProperty="id">
38         insert into da_opcua_config
39         <trim prefix="(" suffix=")" suffixOverrides=",">
40             <if test="node != null">node,</if>
41             <if test="sysTypes != null">sys_types,</if>
42             <if test="subscribe != null">subscribe,</if>
43             <if test="rFunction != null">r_function,</if>
44             <if test="remarks != null">remarks,</if>
45             <if test="processName != null">process_name,</if>
46             <if test="process != null">process,</if>
47             <if test="state != null">state,</if>
48          </trim>
49         <trim prefix="values (" suffix=")" suffixOverrides=",">
50             <if test="node != null">#{node},</if>
51             <if test="sysTypes != null">#{sysTypes},</if>
52             <if test="subscribe != null">#{subscribe},</if>
53             <if test="rFunction != null">#{rFunction},</if>
54             <if test="remarks != null">#{remarks},</if>
55             <if test="processName != null">#{processName},</if>
56             <if test="process != null">#{process},</if>
57             <if test="state != null">#{state},</if>
58          </trim>
59     </insert>
60
61     <update id="updateDaOpcuaConfig" parameterType="DaOpcuaConfig">
62         update da_opcua_config
63         <trim prefix="SET" suffixOverrides=",">
64             <if test="node != null">node = #{node},</if>
65             <if test="sysTypes != null">sys_types = #{sysTypes},</if>
66             <if test="subscribe != null">subscribe = #{subscribe},</if>
67             <if test="rFunction != null">r_function = #{rFunction},</if>
68             <if test="remarks != null">remarks = #{remarks},</if>
69             <if test="processName != null">process_name = #{processName},</if>
70             <if test="process != null">process = #{process},</if>
71             <if test="state != null">state = #{state},</if>
72         </trim>
73         where id = #{id}
74     </update>
75
76     <delete id="deleteDaOpcuaConfigById" parameterType="Long">
77         delete from da_opcua_config where id = #{id}
78     </delete>
79
80     <delete id="deleteDaOpcuaConfigByIds" parameterType="String">
81         delete from da_opcua_config where id in 
82         <foreach item="id" collection="array" open="(" separator="," close=")">
83             #{id}
84         </foreach>
85     </delete>
86 </mapper>