|
|
|
<?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.zhonglai.luhui.device.mapper.IotProtocolClassMapper">
|
|
|
|
|
|
|
|
<resultMap type="IotProtocolClass" id="IotProtocolClassResult">
|
|
|
|
<result property="id" column="id" />
|
|
|
|
<result property="type" column="type" />
|
|
|
|
<result property="name" column="name" />
|
|
|
|
<result property="case_model" column="case_model" />
|
|
|
|
<result property="classname" column="classname" />
|
|
|
|
<result property="create_time" column="create_time" />
|
|
|
|
</resultMap>
|
|
|
|
|
|
|
|
<sql id="selectIotProtocolClassVo">
|
|
|
|
select `id`, `type`, `name`, `case_model`, `classname`, `create_time` from iot_protocol_class
|
|
|
|
</sql>
|
|
|
|
|
|
|
|
<select id="selectIotProtocolClassList" parameterType="IotProtocolClass" resultMap="IotProtocolClassResult">
|
|
|
|
<include refid="selectIotProtocolClassVo"/>
|
|
|
|
<where>
|
|
|
|
<if test="id != null "> and id = #{id}</if>
|
|
|
|
<if test="type != null "> and type = #{type}</if>
|
|
|
|
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
|
|
|
|
<if test="classname != null and classname != ''"> and classname like concat('%', #{classname}, '%')</if>
|
|
|
|
</where>
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<select id="selectIotProtocolClassById" parameterType="Integer" resultMap="IotProtocolClassResult">
|
|
|
|
<include refid="selectIotProtocolClassVo"/>
|
|
|
|
where id = #{id}
|
|
|
|
</select>
|
|
|
|
|
|
|
|
<insert id="insertIotProtocolClass" parameterType="IotProtocolClass" useGeneratedKeys="true" keyProperty="id">
|
|
|
|
insert into iot_protocol_class
|
|
|
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="type != null">`type`,</if>
|
|
|
|
<if test="name != null">`name`,</if>
|
|
|
|
<if test="case_model != null">`case_model`,</if>
|
|
|
|
<if test="classname != null">`classname`,</if>
|
|
|
|
<if test="create_time != null">`create_time`,</if>
|
|
|
|
</trim>
|
|
|
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
|
|
|
<if test="type != null">#{type},</if>
|
|
|
|
<if test="name != null">#{name},</if>
|
|
|
|
<if test="case_model != null">#{case_model},</if>
|
|
|
|
<if test="classname != null">#{classname},</if>
|
|
|
|
<if test="create_time != null">#{create_time},</if>
|
|
|
|
</trim>
|
|
|
|
</insert>
|
|
|
|
|
|
|
|
<update id="updateIotProtocolClass" parameterType="IotProtocolClass">
|
|
|
|
update iot_protocol_class
|
|
|
|
<trim prefix="SET" suffixOverrides=",">
|
|
|
|
<if test="type != null">`type` = #{type},</if>
|
|
|
|
<if test="name != null">`name` = #{name},</if>
|
|
|
|
<if test="case_model != null">`case_model` = #{case_model},</if>
|
|
|
|
<if test="classname != null">`classname` = #{classname},</if>
|
|
|
|
<if test="create_time != null">`create_time` = #{create_time},</if>
|
|
|
|
</trim>
|
|
|
|
where id = #{id}
|
|
|
|
</update>
|
|
|
|
|
|
|
|
<delete id="deleteIotProtocolClassById" parameterType="Integer">
|
|
|
|
delete from iot_protocol_class where id = #{id}
|
|
|
|
</delete>
|
|
|
|
|
|
|
|
<delete id="deleteIotProtocolClassByIds" parameterType="String">
|
|
|
|
delete from iot_protocol_class where id in
|
|
|
|
<foreach item="id" collection="array" open="(" separator="," close=")">
|
|
|
|
#{id}
|
|
|
|
</foreach>
|
|
|
|
</delete>
|
|
|
|
</mapper> |
|
|
\ No newline at end of file |
...
|
...
|
|