TElecdashboardAlarmMapper.xml 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.ruoyi.project.aspen.mapper.TElecdashboardAlarmMapper">
  6. <resultMap type="TElecdashboardAlarm" id="TElecdashboardAlarmResult">
  7. <result property="id" column="id" />
  8. <result property="alarmValue" column="alarm_value" />
  9. <result property="alarmTime" column="alarm_time" />
  10. <result property="code" column="code" />
  11. <result property="description" column="description" />
  12. <result property="deptName" column="dept_name" />
  13. </resultMap>
  14. <sql id="selectTElecdashboardAlarmVo">
  15. select d.id, d.alarm_value, d.code, d.description, d.alarm_time from t_elecdashboard_alarm d
  16. </sql>
  17. <select id="selectTElecdashboardAlarmList" parameterType="TElecdashboardAlarm" resultMap="TElecdashboardAlarmResult">
  18. <include refid="selectTElecdashboardAlarmVo"/>
  19. <where>
  20. <if test="alarmValue != null "> and alarm_value = #{alarmValue}</if>
  21. <if test="code != null "> and code = #{code}</if>
  22. <if test="description != null "> and description = #{description}</if>
  23. </where>
  24. <!-- 数据范围过滤 -->
  25. ${params.dataScope}
  26. </select>
  27. <select id="selectTElecdashboardAlarmById" parameterType="Long" resultMap="TElecdashboardAlarmResult">
  28. <include refid="selectTElecdashboardAlarmVo"/>
  29. where id = #{id}
  30. </select>
  31. <insert id="insertTElecdashboardAlarm" parameterType="TElecdashboardAlarm">
  32. insert into t_elecdashboard_alarm
  33. <trim prefix="(" suffix=")" suffixOverrides=",">
  34. <if test="id != null">id,</if>
  35. <if test="alarmValue != null">alarm_value,</if>
  36. <if test="code != null">code,</if>
  37. <if test="description != null">description,</if>
  38. </trim>
  39. <trim prefix="values (" suffix=")" suffixOverrides=",">
  40. <if test="id != null">#{id},</if>
  41. <if test="alarmValue != null">#{alarmValue},</if>
  42. <if test="code != null">#{code},</if>
  43. <if test="description != null">#{description},</if>
  44. </trim>
  45. </insert>
  46. <update id="updateTElecdashboardAlarm" parameterType="TElecdashboardAlarm">
  47. update t_elecdashboard_alarm
  48. <trim prefix="SET" suffixOverrides=",">
  49. <if test="alarmValue != null">alarm_value = #{alarmValue},</if>
  50. <if test="code != null">code = #{code},</if>
  51. <if test="description != null">description = #{description},</if>
  52. </trim>
  53. where id = #{id}
  54. </update>
  55. <update id="deleteTElecdashboardAlarmById" parameterType="Long">
  56. update t_elecdashboard_alarm set del_flag = 2 where id = #{id}
  57. </update>
  58. <update id="deleteTElecdashboardAlarmByIds" parameterType="String">
  59. update t_elecdashboard_alarm set del_flag = 2 where id in
  60. <foreach item="id" collection="array" open="(" separator="," close=")">
  61. #{id}
  62. </foreach>
  63. </update>
  64. </mapper>