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