春风项目四线(合箱线、总装线)
yyt
2024-01-23 28cd73a27061f684feda88d2d3e5f26794bbd591
提交 | 用户 | 时间
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>
28             <if test="state != null "> and state = #{state}</if>
e4c3b0 29         </where>
Y 30     </select>
31     
32     <select id="selectDaOpcuaConfigById" parameterType="Long" resultMap="DaOpcuaConfigResult">
33         <include refid="selectDaOpcuaConfigVo"/>
34         where id = #{id}
35     </select>
36         
054abe 37     <insert id="insertDaOpcuaConfig" parameterType="DaOpcuaConfig" useGeneratedKeys="true" keyProperty="id">
e4c3b0 38         insert into da_opcua_config
Y 39         <trim prefix="(" suffix=")" suffixOverrides=",">
28cd73 40             <if test="node != null">node,</if>
Y 41             <if test="sysTypes != null">sys_types,</if>
e4c3b0 42             <if test="subscribe != null">subscribe,</if>
28cd73 43             <if test="rFunction != null">r_function,</if>
e4c3b0 44             <if test="remarks != null">remarks,</if>
054abe 45             <if test="processName != null">process_name,</if>
28cd73 46             <if test="process != null">process,</if>
054abe 47             <if test="state != null">state,</if>
e4c3b0 48          </trim>
Y 49         <trim prefix="values (" suffix=")" suffixOverrides=",">
28cd73 50             <if test="node != null">#{node},</if>
Y 51             <if test="sysTypes != null">#{sysTypes},</if>
e4c3b0 52             <if test="subscribe != null">#{subscribe},</if>
28cd73 53             <if test="rFunction != null">#{rFunction},</if>
e4c3b0 54             <if test="remarks != null">#{remarks},</if>
054abe 55             <if test="processName != null">#{processName},</if>
28cd73 56             <if test="process != null">#{process},</if>
054abe 57             <if test="state != null">#{state},</if>
e4c3b0 58          </trim>
Y 59     </insert>
60
61     <update id="updateDaOpcuaConfig" parameterType="DaOpcuaConfig">
62         update da_opcua_config
63         <trim prefix="SET" suffixOverrides=",">
28cd73 64             <if test="node != null">node = #{node},</if>
Y 65             <if test="sysTypes != null">sys_types = #{sysTypes},</if>
e4c3b0 66             <if test="subscribe != null">subscribe = #{subscribe},</if>
28cd73 67             <if test="rFunction != null">r_function = #{rFunction},</if>
e4c3b0 68             <if test="remarks != null">remarks = #{remarks},</if>
054abe 69             <if test="processName != null">process_name = #{processName},</if>
28cd73 70             <if test="process != null">process = #{process},</if>
054abe 71             <if test="state != null">state = #{state},</if>
e4c3b0 72         </trim>
Y 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>