GoafSensorAlarmReportMapper.xml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  3. "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
  4. <mapper namespace="com.zhyc.xps.goaf.mapper.GoafSensorAlarmReportMapper">
  5. <resultMap id="GoafSensorAlarmReportMapper" type="com.zhyc.xps.goaf.entity.GoafSensorAlarmReport">
  6. <id column="goaf_sensor_alarm_report_id" property="goafSensorAlarmReportId" jdbcType="BIGINT"/>
  7. <result column="oc_id" property="ocId" jdbcType="BIGINT"/>
  8. <result column="goaf_sensor_alarm_finish_num" property="goafSensorAlarmFinishNum" jdbcType="BIGINT"/>
  9. <result column="goaf_sensor_alarm_end_num" property="goafSensorAlarmEndNum" jdbcType="BIGINT"/>
  10. <result column="goaf_sensor_alarm_report_content" property="goafSensorAlarmReportContent" jdbcType="VARCHAR"/>
  11. <result column="goaf_sensor_alarm_report_time" property="goafSensorAlarmReportTime" jdbcType="TIMESTAMP"/>
  12. </resultMap>
  13. <select id="getByAlarmReportId" parameterType="java.util.Map" resultMap="GoafSensorAlarmReportMapper">
  14. SELECT *
  15. FROM goaf_sensor_alarm_report
  16. WHERE goaf_sensor_alarm_report_id = #{goafSensorAlarmReportId ,jdbcType=BIGINT}
  17. </select>
  18. <select id="getByList" parameterType="java.util.Map" resultMap="GoafSensorAlarmReportMapper">
  19. SELECT *
  20. FROM goaf_sensor_alarm_report
  21. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  22. ORDER BY goaf_sensor_alarm_report_time DESC
  23. </select>
  24. <select id="getByPage" parameterType="java.util.Map" resultMap="GoafSensorAlarmReportMapper">
  25. SELECT *
  26. FROM goaf_sensor_alarm_report
  27. WHERE oc_id = #{ocId ,jdbcType=BIGINT}
  28. ORDER BY goaf_sensor_alarm_report_time DESC
  29. </select>
  30. <insert id="create" parameterType="com.zhyc.xps.goaf.entity.GoafSensorAlarmReport">
  31. insert into goaf_sensor_alarm_report
  32. <trim prefix="(" suffix=")" suffixOverrides=",">
  33. <if test="goafSensorAlarmReportId != null">
  34. goaf_sensor_alarm_report_id,
  35. </if>
  36. <if test="ocId != null">
  37. oc_id,
  38. </if>
  39. <if test="goafSensorAlarmFinishNum != null">
  40. goaf_sensor_alarm_finish_num,
  41. </if>
  42. <if test="goafSensorAlarmEndNum != null">
  43. goaf_sensor_alarm_end_num,
  44. </if>
  45. <if test="goafSensorAlarmReportContent != null and goafSensorAlarmReportContent != ''">
  46. goaf_sensor_alarm_report_content,
  47. </if>
  48. <if test="goafSensorAlarmReportTime != null">
  49. goaf_sensor_alarm_report_time,
  50. </if>
  51. </trim>
  52. <trim prefix="values (" suffix=")" suffixOverrides=",">
  53. <if test="goafSensorAlarmReportId != null">
  54. #{goafSensorAlarmReportId, jdbcType=BIGINT},
  55. </if>
  56. <if test="ocId != null">
  57. #{ocId, jdbcType=BIGINT},
  58. </if>
  59. <if test="goafSensorAlarmFinishNum != null">
  60. #{goafSensorAlarmFinishNum, jdbcType=BIGINT},
  61. </if>
  62. <if test="goafSensorAlarmEndNum != null">
  63. #{goafSensorAlarmEndNum, jdbcType=BIGINT},
  64. </if>
  65. <if test="goafSensorAlarmReportContent != null and goafSensorAlarmReportContent != ''">
  66. #{goafSensorAlarmReportContent, jdbcType=VARCHAR},
  67. </if>
  68. <if test="goafSensorAlarmReportTime != null">
  69. #{goafSensorAlarmReportTime, jdbcType=TIMESTAMP},
  70. </if>
  71. </trim>
  72. </insert>
  73. <!--Update更新-->
  74. <update id="update" parameterType="com.zhyc.xps.goaf.entity.GoafSensorAlarmReport">
  75. UPDATE goaf_sensor_alarm_report
  76. <trim suffixOverrides=",">
  77. <set>
  78. <if test="goafSensorAlarmFinishNum != null">
  79. goaf_sensor_alarm_finish_num = #{goafSensorAlarmFinishNum, jdbcType=BIGINT},
  80. </if>
  81. <if test="goafSensorAlarmEndNum != null">
  82. goaf_sensor_alarm_end_num = #{goafSensorAlarmEndNum, jdbcType=BIGINT},
  83. </if>
  84. <if test="goafSensorAlarmReportContent != null and goafSensorAlarmReportContent != ''">
  85. goaf_sensor_alarm_report_content = #{goafSensorAlarmReportContent, jdbcType=VARCHAR},
  86. </if>
  87. </set>
  88. </trim>
  89. WHERE goaf_sensor_alarm_report_id = #{goafSensorAlarmReportId, jdbcType=BIGINT}
  90. </update>
  91. </mapper>