WatchMsgSetMapper.xml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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.fs.watch.mapper.WatchMsgSetMapper">
  6. <resultMap type="WatchMsgSet" id="WatchMsgSetResult">
  7. <result property="id" column="id" />
  8. <result property="createTime" column="create_time" />
  9. <result property="updateTime" column="update_time" />
  10. <result property="msgType" column="msg_type" />
  11. <result property="msgTitle" column="msg_title" />
  12. <result property="msgDescription" column="msg_description" />
  13. <result property="detailsType" column="details_type" />
  14. <result property="normalRule" column="normal_rule" />
  15. <result property="abnormalRule" column="abnormal_rule" />
  16. <result property="status" column="status" />
  17. </resultMap>
  18. <sql id="selectWatchMsgSetVo">
  19. select id, create_time, update_time, msg_type, msg_title, msg_description, details_type, normal_rule, abnormal_rule,status from watch_msg_set
  20. </sql>
  21. <select id="selectWatchMsgSetList" parameterType="WatchMsgSet" resultMap="WatchMsgSetResult">
  22. <include refid="selectWatchMsgSetVo"/>
  23. <where>
  24. <if test="msgType != null "> and msg_type = #{msgType}</if>
  25. <if test="msgTitle != null and msgTitle != ''"> and msg_title = #{msgTitle}</if>
  26. <if test="msgDescription != null and msgDescription != ''"> and msg_description = #{msgDescription}</if>
  27. <if test="detailsType != null and detailsType != ''"> and details_type = #{detailsType}</if>
  28. <if test="normalRule != null "> and normal_rule = #{normalRule}</if>
  29. <if test="abnormalRule != null "> and abnormal_rule = #{abnormalRule}</if>
  30. <if test="status != null "> and status = #{status}</if>
  31. </where>
  32. </select>
  33. <select id="selectWatchMsgSetById" parameterType="Integer" resultMap="WatchMsgSetResult">
  34. <include refid="selectWatchMsgSetVo"/>
  35. where id = #{id}
  36. </select>
  37. <insert id="insertWatchMsgSet" parameterType="WatchMsgSet" useGeneratedKeys="true" keyProperty="id">
  38. insert into watch_msg_set
  39. <trim prefix="(" suffix=")" suffixOverrides=",">
  40. <if test="createTime != null">create_time,</if>
  41. <if test="updateTime != null">update_time,</if>
  42. <if test="msgType != null">msg_type,</if>
  43. <if test="msgTitle != null">msg_title,</if>
  44. <if test="msgDescription != null">msg_description,</if>
  45. <if test="detailsType != null">details_type,</if>
  46. <if test="normalRule != null">normal_rule,</if>
  47. <if test="abnormalRule != null">abnormal_rule,</if>
  48. <if test="status != null">abnormal_rule,</if>
  49. </trim>
  50. <trim prefix="values (" suffix=")" suffixOverrides=",">
  51. <if test="createTime != null">#{createTime},</if>
  52. <if test="updateTime != null">#{updateTime},</if>
  53. <if test="msgType != null">#{msgType},</if>
  54. <if test="msgTitle != null">#{msgTitle},</if>
  55. <if test="msgDescription != null">#{msgDescription},</if>
  56. <if test="detailsType != null">#{detailsType},</if>
  57. <if test="normalRule != null">#{normalRule},</if>
  58. <if test="abnormalRule != null">#{abnormalRule},</if>
  59. <if test="status != null">#{status},</if>
  60. </trim>
  61. </insert>
  62. <update id="updateWatchMsgSet" parameterType="WatchMsgSet">
  63. update watch_msg_set
  64. <trim prefix="SET" suffixOverrides=",">
  65. <if test="createTime != null">create_time = #{createTime},</if>
  66. <if test="updateTime != null">update_time = #{updateTime},</if>
  67. <if test="msgType != null">msg_type = #{msgType},</if>
  68. <if test="msgTitle != null">msg_title = #{msgTitle},</if>
  69. <if test="msgDescription != null">msg_description = #{msgDescription},</if>
  70. <if test="detailsType != null">details_type = #{detailsType},</if>
  71. <if test="normalRule != null">normal_rule = #{normalRule},</if>
  72. <if test="abnormalRule != null">abnormal_rule = #{abnormalRule},</if>
  73. <if test="status != null">status = #{status},</if>
  74. </trim>
  75. where id = #{id}
  76. </update>
  77. <delete id="deleteWatchMsgSetById" parameterType="Integer">
  78. delete from watch_msg_set where id = #{id}
  79. </delete>
  80. <delete id="deleteWatchMsgSetByIds" parameterType="String">
  81. delete from watch_msg_set where id in
  82. <foreach item="id" collection="array" open="(" separator="," close=")">
  83. #{id}
  84. </foreach>
  85. </delete>
  86. </mapper>