12345678910111213141516171819202122 |
- <!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.IotEntityDataDao">
- <resultMap type="com.bosshand.virgo.ringzle.model.IotEntityData" id="iotEntityDataResult">
- <id column="id" property="id"/>
- <result column="iotEntityId" property="iotEntityId"/>
- <result column="data" property="data"/>
- <result column="date" property="date"/>
- </resultMap>
- <insert id="save" parameterType="com.bosshand.virgo.ringzle.model.IotEntityData" useGeneratedKeys="true" keyProperty="id">
- INSERT INTO iot_entity_data (iotEntityId,data,date) VALUES (#{iotEntityId},#{data},now());
- </insert>
- <select id="get" resultMap="iotEntityDataResult">
- select * from iot_entity_data where iotEntityId = #{iotEntityId} order by date desc limit 0,1;
- </select>
- </mapper>
|