春风项目四线(合箱线、总装线)
yyt
2024-01-25 f0b395a1b77a4999e89a164fc997f96d9942c3b1
提交 | 用户 | 时间
e4c3b0 1 <?xml version="1.0" encoding="UTF-8" ?>
Y 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"    />
054abe 13         <result property="processName"    column="process_name"    />
28cd73 14         <result property="process"    column="process"    />
054abe 15         <result property="state"    column="state"    />
e4c3b0 16     </resultMap>
Y 17
18     <sql id="selectDaOpcuaConfigVo">
28cd73 19         select id, node, sys_types, subscribe, r_function, remarks, process_name, process, state from da_opcua_config
e4c3b0 20     </sql>
Y 21
22     <select id="selectDaOpcuaConfigList" parameterType="DaOpcuaConfig" resultMap="DaOpcuaConfigResult">
23         <include refid="selectDaOpcuaConfigVo"/>
24         <where>  
054abe 25             <if test="node != null  and node != ''"> and node = #{node}</if>
Y 26             <if test="rFunction != null  and rFunction != ''"> and r_function = #{rFunction}</if>
27             <if test="process != null  and process != ''"> and process = #{process}</if>
f0b395 28             <if test="subscribe != null  and subscribe != ''"> and subscribe = #{subscribe}</if>
054abe 29             <if test="state != null "> and state = #{state}</if>
e4c3b0 30         </where>
Y 31     </select>
32     
33     <select id="selectDaOpcuaConfigById" parameterType="Long" resultMap="DaOpcuaConfigResult">
34         <include refid="selectDaOpcuaConfigVo"/>
35         where id = #{id}
36     </select>
37         
054abe 38     <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig" useGeneratedKeys="true" keyProperty="id">
e4c3b0 39         insert into da_opcua_config
Y 40         <trim prefix="(" suffix=")" suffixOverrides=",">
28cd73 41             <if test="node != null">node,</if>
Y 42             <if test="sysTypes != null">sys_types,</if>
e4c3b0 43             <if test="subscribe != null">subscribe,</if>
28cd73 44             <if test="rFunction != null">r_function,</if>
e4c3b0 45             <if test="remarks != null">remarks,</if>
054abe 46             <if test="processName != null">process_name,</if>
28cd73 47             <if test="process != null">process,</if>
054abe 48             <if test="state != null">state,</if>
e4c3b0 49          </trim>
Y 50         <trim prefix="values (" suffix=")" suffixOverrides=",">
28cd73 51             <if test="node != null">#{node},</if>
Y 52             <if test="sysTypes != null">#{sysTypes},</if>
e4c3b0 53             <if test="subscribe != null">#{subscribe},</if>
28cd73 54             <if test="rFunction != null">#{rFunction},</if>
e4c3b0 55             <if test="remarks != null">#{remarks},</if>
054abe 56             <if test="processName != null">#{processName},</if>
28cd73 57             <if test="process != null">#{process},</if>
054abe 58             <if test="state != null">#{state},</if>
e4c3b0 59          </trim>
Y 60     </insert>
61
62     <update id="updateDaOpcuaConfig" parameterType="DaOpcuaConfig">
63         update da_opcua_config
64         <trim prefix="SET" suffixOverrides=",">
28cd73 65             <if test="node != null">node = #{node},</if>
Y 66             <if test="sysTypes != null">sys_types = #{sysTypes},</if>
e4c3b0 67             <if test="subscribe != null">subscribe = #{subscribe},</if>
28cd73 68             <if test="rFunction != null">r_function = #{rFunction},</if>
e4c3b0 69             <if test="remarks != null">remarks = #{remarks},</if>
054abe 70             <if test="processName != null">process_name = #{processName},</if>
28cd73 71             <if test="process != null">process = #{process},</if>
054abe 72             <if test="state != null">state = #{state},</if>
e4c3b0 73         </trim>
Y 74         where id = #{id}
75     </update>
76
77     <delete id="deleteDaOpcuaConfigById" parameterType="Long">
78         delete from da_opcua_config where id = #{id}
79     </delete>
80
81     <delete id="deleteDaOpcuaConfigByIds" parameterType="String">
82         delete from da_opcua_config where id in 
83         <foreach item="id" collection="array" open="(" separator="," close=")">
84             #{id}
85         </foreach>
86     </delete>
87 </mapper>