12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="cn.ourwill.module.house.dao.dm.DeviceGetLogDao">
- <resultMap id="baseMap" type="cn.ourwill.module.house.entity.dm.DeviceGetLog">
- <result column="id" property="id"></result>
- <result column="get_uuid" property="getUuid"/>
- <result column="device_uuid" property="deviceUuid"/>
- <result column="sync_flag" property="syncFlag"/>
- </resultMap>
-
- <sql id="columns">
- id,
- get_uuid,
- device_uuid,
- sync_flag
- </sql>
- <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
- parameterType="cn.ourwill.module.house.entity.dm.DeviceGetLog">
- INSERT device_get_log
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- id,
- </if>
- <if test="deviceUuid != null">
- device_uuid,
- </if>
- <if test=" getUuid != null">
- get_uuid,
- </if>
- <!--<if test=" syncFlag != null">
- sync_flag,
- </if>-->
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test=" id != null">
- #{id}, </if>
- <if test=" deviceUuid != null">
- #{deviceUuid}, </if>
- <if test="getUuid != null">
- #{getUuid} </if>
- <!-- <if test=" syncFlag != null">
- #{syncFlag}
- </if>-->
- </trim>
- </insert>
- <select id="getByUuid" resultMap="baseMap">
- SELECT
- <include refid="columns"/>
- FROM device_get_log a
- WHERE a.get_uuid = #{getUuid}
- </select>
- <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.dm.DeviceGetLog">
- UPDATE device_get_log <set>
- <if test="uuid != null">
- uuid= #{uuid} ,
- </if>
- <if test=" deviceUuid != null">
- device_uuid= #{deviceUuid},
- </if>
- <if test="getUuid != null">
- get_uuid= #{getUuid},
- </if>
- <!--<if test="syncFlag !=null">
- sync_flag = #{syncFlag} ,
- </if>-->
- </set>
- WHERE uuid = #{uuid}
- </update>
- </mapper>
|