<?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.billion.main.sc.mapper.ScOpcConfMapper">
|
|
<resultMap type="ScOpcConf" id="ScOpcConfResult">
|
<result property="id" column="id" />
|
<result property="locationCode" column="location_code" />
|
<result property="locationName" column="location_name" />
|
<result property="node" column="node" />
|
<result property="type" column="type" />
|
<result property="subscribe" column="subscribe" />
|
<result property="delFlag" column="del_flag" />
|
<result property="createBy" column="create_by" />
|
<result property="createTime" column="create_time" />
|
<result property="updateBy" column="update_by" />
|
<result property="updateTime" column="update_time" />
|
</resultMap>
|
|
<sql id="selectScOpcConfVo">
|
select id, location_code, location_name, node, type, subscribe, del_flag, create_by, create_time, update_by, update_time from sc_opc_conf
|
</sql>
|
|
<select id="selectScOpcConfList" parameterType="ScOpcConf" resultMap="ScOpcConfResult">
|
<include refid="selectScOpcConfVo"/>
|
<where>
|
<if test="locationCode != null and locationCode != ''"> and location_code like concat('%', #{locationCode}, '%')</if>
|
<if test="locationName != null and locationName != ''"> and location_name like concat('%', #{locationName}, '%')</if>
|
<if test="node != null and node != ''"> and node like concat('%', #{node}, '%')</if>
|
<if test="type != null and type != ''"> and type = #{type}</if>
|
<if test="subscribe != null and subscribe != ''"> and subscribe = #{subscribe}</if>
|
</where>
|
</select>
|
|
<select id="selectScOpcConfById" parameterType="Long" resultMap="ScOpcConfResult">
|
<include refid="selectScOpcConfVo"/>
|
where id = #{id}
|
</select>
|
|
<insert id="insertScOpcConf" parameterType="ScOpcConf" useGeneratedKeys="true" keyProperty="id">
|
insert into sc_opc_conf
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
<if test="locationCode != null">location_code,</if>
|
<if test="locationName != null">location_name,</if>
|
<if test="node != null">node,</if>
|
<if test="type != null">type,</if>
|
<if test="subscribe != null">subscribe,</if>
|
<if test="delFlag != null">del_flag,</if>
|
<if test="createBy != null">create_by,</if>
|
<if test="createTime != null">create_time,</if>
|
<if test="updateBy != null">update_by,</if>
|
<if test="updateTime != null">update_time,</if>
|
</trim>
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
<if test="locationCode != null">#{locationCode},</if>
|
<if test="locationName != null">#{locationName},</if>
|
<if test="node != null">#{node},</if>
|
<if test="type != null">#{type},</if>
|
<if test="subscribe != null">#{subscribe},</if>
|
<if test="delFlag != null">#{delFlag},</if>
|
<if test="createBy != null">#{createBy},</if>
|
<if test="createTime != null">#{createTime},</if>
|
<if test="updateBy != null">#{updateBy},</if>
|
<if test="updateTime != null">#{updateTime},</if>
|
</trim>
|
</insert>
|
|
<update id="updateScOpcConf" parameterType="ScOpcConf">
|
update sc_opc_conf
|
<trim prefix="SET" suffixOverrides=",">
|
<if test="locationCode != null">location_code = #{locationCode},</if>
|
<if test="locationName != null">location_name = #{locationName},</if>
|
<if test="node != null">node = #{node},</if>
|
<if test="type != null">type = #{type},</if>
|
<if test="subscribe != null">subscribe = #{subscribe},</if>
|
<if test="delFlag != null">del_flag = #{delFlag},</if>
|
<if test="createBy != null">create_by = #{createBy},</if>
|
<if test="createTime != null">create_time = #{createTime},</if>
|
<if test="updateBy != null">update_by = #{updateBy},</if>
|
<if test="updateTime != null">update_time = #{updateTime},</if>
|
</trim>
|
where id = #{id}
|
</update>
|
|
<delete id="deleteScOpcConfById" parameterType="Long">
|
delete from sc_opc_conf where id = #{id}
|
</delete>
|
|
<delete id="deleteScOpcConfByIds" parameterType="String">
|
delete from sc_opc_conf where id in
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
#{id}
|
</foreach>
|
</delete>
|
</mapper>
|