DeviceGetLogDao.xml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  2. <mapper namespace="cn.ourwill.module.house.dao.dm.DeviceGetLogDao">
  3. <resultMap id="baseMap" type="cn.ourwill.module.house.entity.dm.DeviceGetLog">
  4. <result column="id" property="id"></result>
  5. <result column="get_uuid" property="getUuid"/>
  6. <result column="device_uuid" property="deviceUuid"/>
  7. <result column="sync_flag" property="syncFlag"/>
  8. </resultMap>
  9. <sql id="columns">
  10. id,
  11. get_uuid,
  12. device_uuid,
  13. sync_flag
  14. </sql>
  15. <insert id="insert" keyColumn="id" keyProperty="id" useGeneratedKeys="true"
  16. parameterType="cn.ourwill.module.house.entity.dm.DeviceGetLog">
  17. INSERT device_get_log
  18. <trim prefix="(" suffix=")" suffixOverrides=",">
  19. <if test=" id != null">
  20. id,
  21. </if>
  22. <if test="deviceUuid != null">
  23. device_uuid,
  24. </if>
  25. <if test=" getUuid != null">
  26. get_uuid,
  27. </if>
  28. <!--<if test=" syncFlag != null">
  29. sync_flag,
  30. </if>-->
  31. </trim>
  32. <trim prefix="values (" suffix=")" suffixOverrides=",">
  33. <if test=" id != null">
  34. #{id}, </if>
  35. <if test=" deviceUuid != null">
  36. #{deviceUuid}, </if>
  37. <if test="getUuid != null">
  38. #{getUuid} </if>
  39. <!-- <if test=" syncFlag != null">
  40. #{syncFlag}
  41. </if>-->
  42. </trim>
  43. </insert>
  44. <select id="getByUuid" resultMap="baseMap">
  45. SELECT
  46. <include refid="columns"/>
  47. FROM device_get_log a
  48. WHERE a.get_uuid = #{getUuid}
  49. </select>
  50. <update id="updateByUuid" parameterType="cn.ourwill.module.house.entity.dm.DeviceGetLog">
  51. UPDATE device_get_log <set>
  52. <if test="uuid != null">
  53. uuid= #{uuid} ,
  54. </if>
  55. <if test=" deviceUuid != null">
  56. device_uuid= #{deviceUuid},
  57. </if>
  58. <if test="getUuid != null">
  59. get_uuid= #{getUuid},
  60. </if>
  61. <!--<if test="syncFlag !=null">
  62. sync_flag = #{syncFlag} ,
  63. </if>-->
  64. </set>
  65. WHERE uuid = #{uuid}
  66. </update>
  67. </mapper>