123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960 |
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.bosshand.virgo.ringzle.dao.IotEntityDao">
- <resultMap type="com.bosshand.virgo.ringzle.model.IotEntity" id="iotEntityResult">
- <id column="id" property="id"/>
- <result column="name" property="name"/>
- <result column="iotEntityId" property="iotEntityId"/>
- <result column="entityType" property="entityType"/>
- <result column="modelType" property="modelType"/>
- </resultMap>
- <insert id="save" parameterType="com.bosshand.virgo.ringzle.model.IotEntity" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO iot_entity (name,iotEntityId,entityType,modelType) VALUES
- (#{name},#{iotEntityId},#{entityType},#{modelType});
- </insert>
- <select id="get" resultMap="iotEntityResult">
- select * from iot_entity where iotEntityId = #{iotEntityId}
- </select>
- <select id="getList" resultMap="iotEntityResult">
- select * from iot_entity
- <where>
- <if test="id != 0">
- and id =#{id}
- </if>
- <if test="name != null">
- and name =#{name}
- </if>
- <if test="iotEntityId != null">
- and iotEntityId =#{iotEntityId}
- </if>
- <if test="entityType != null">
- and entityType =#{entityType}
- </if>
- <if test="modelType != null">
- and modelType =#{modelType}
- </if>
- </where>
- </select>
- <update id="update">
- update iot_entity
- <trim prefix="set" suffixOverrides=",">
- <if test="name!=null">name=#{name},</if>
- <if test="iotEntityId!=null">iotEntityId=#{iotEntityId},</if>
- <if test="entityType!=null">entityType=#{entityType},</if>
- <if test="modelType!=null">modelType=#{modelType},</if>
- </trim>
- where id=#{id}
- </update>
- <delete id="delete">
- delete FROM iot_entity where id=#{id}
- </delete>
- </mapper>
|