MonitorParameterConfigMapper.xml 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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.phm.manage.mapper.MonitorParameterConfigMapper">
  6. <resultMap type="MonitorParameterConfig" id="MonitorParameterConfigResult">
  7. <result property="id" column="id"/>
  8. <result property="name" column="name"/>
  9. <result property="busRotocol" column="bus_rotocol"/>
  10. <result property="dataBlock" column="data_block"/>
  11. <result property="dataWord" column="data_word"/>
  12. <result property="isDelete" column="is_delete"/>
  13. <result property="createBy" column="create_by"/>
  14. <result property="createTime" column="create_time"/>
  15. <result property="updateBy" column="update_by"/>
  16. <result property="updateTime" column="update_time"/>
  17. </resultMap>
  18. <sql id="selectMonitorParameterConfigVo">
  19. select id,
  20. name,
  21. bus_rotocol,
  22. data_block,
  23. data_word,
  24. is_delete,
  25. create_by,
  26. create_time,
  27. update_by,
  28. update_time
  29. from PHM.PHM_MONITOR_PARAMETER_CONFIG
  30. </sql>
  31. <select id="selectMonitorParameterConfigList" parameterType="MonitorParameterConfig"
  32. resultMap="MonitorParameterConfigResult">
  33. <include refid="selectMonitorParameterConfigVo"/>
  34. <where>
  35. <if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
  36. <if test="busRotocol != null and busRotocol != ''">and bus_rotocol = #{busRotocol}</if>
  37. <if test="dataBlock != null and dataBlock != ''">and data_block = #{dataBlock}</if>
  38. <if test="dataWord != null and dataWord != ''">and data_word = #{dataWord}</if>
  39. <if test="isDelete != null ">and is_delete = #{isDelete}</if>
  40. <if test="createBy != null and createBy != ''">and create_by = #{createBy}</if>
  41. <if test="createTime != null ">and create_time = #{createTime}</if>
  42. <if test="updateBy != null and updateBy != ''">and update_by = #{updateBy}</if>
  43. <if test="updateTime != null ">and update_time = #{updateTime}</if>
  44. </where>
  45. </select>
  46. <select id="selectMonitorParameterConfigById" parameterType="Long" resultMap="MonitorParameterConfigResult">
  47. <include refid="selectMonitorParameterConfigVo"/>
  48. where id = #{id}
  49. </select>
  50. <insert id="insertMonitorParameterConfig" parameterType="MonitorParameterConfig">
  51. insert into PHM.PHM_MONITOR_PARAMETER_CONFIG
  52. <trim prefix="(" suffix=")" suffixOverrides=",">
  53. <if test="id != null">id,</if>
  54. <if test="name != null">name,</if>
  55. <if test="busRotocol != null">bus_rotocol,</if>
  56. <if test="dataBlock != null">data_block,</if>
  57. <if test="dataWord != null">data_word,</if>
  58. <if test="isDelete != null">is_delete,</if>
  59. <if test="createBy != null">create_by,</if>
  60. <if test="createTime != null">create_time,</if>
  61. <if test="updateBy != null">update_by,</if>
  62. <if test="updateTime != null">update_time,</if>
  63. </trim>
  64. <trim prefix="values (" suffix=")" suffixOverrides=",">
  65. <if test="id != null">#{id},</if>
  66. <if test="name != null">#{name},</if>
  67. <if test="busRotocol != null">#{busRotocol},</if>
  68. <if test="dataBlock != null">#{dataBlock},</if>
  69. <if test="dataWord != null">#{dataWord},</if>
  70. <if test="isDelete != null">#{isDelete},</if>
  71. <if test="createBy != null">#{createBy},</if>
  72. <if test="createTime != null">#{createTime},</if>
  73. <if test="updateBy != null">#{updateBy},</if>
  74. <if test="updateTime != null">#{updateTime},</if>
  75. </trim>
  76. </insert>
  77. <update id="updateMonitorParameterConfig" parameterType="MonitorParameterConfig">
  78. update PHM.PHM_MONITOR_PARAMETER_CONFIG
  79. <trim prefix="SET" suffixOverrides=",">
  80. <if test="name != null">name = #{name},</if>
  81. <if test="busRotocol != null">bus_rotocol = #{busRotocol},</if>
  82. <if test="dataBlock != null">data_block = #{dataBlock},</if>
  83. <if test="dataWord != null">data_word = #{dataWord},</if>
  84. <if test="isDelete != null">is_delete = #{isDelete},</if>
  85. <if test="createBy != null">create_by = #{createBy},</if>
  86. <if test="createTime != null">create_time = #{createTime},</if>
  87. <if test="updateBy != null">update_by = #{updateBy},</if>
  88. <if test="updateTime != null">update_time = #{updateTime},</if>
  89. </trim>
  90. where id = #{id}
  91. </update>
  92. <delete id="deleteMonitorParameterConfigById" parameterType="Long">
  93. delete
  94. from PHM.PHM_MONITOR_PARAMETER_CONFIG
  95. where id = #{id}
  96. </delete>
  97. <delete id="deleteMonitorParameterConfigByIds" parameterType="String">
  98. delete from PHM.PHM_MONITOR_PARAMETER_CONFIG where id in
  99. <foreach item="id" collection="array" open="(" separator="," close=")">
  100. #{id}
  101. </foreach>
  102. </delete>
  103. </mapper>