SysMessageConfigMapper.xml 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  3. <!-- 这个文件是自动生成的。 不要修改此文件。所有改动将在下次重新自动生成时丢失。 -->
  4. <mapper namespace="com.ym.mec.biz.dal.dao.SysMessageConfigDao">
  5. <resultMap type="com.ym.mec.biz.dal.entity.SysMessageConfig"
  6. id="SysMessageConfig">
  7. <result column="id_" property="id" />
  8. <result column="message_type_" property="messageType"
  9. typeHandler="com.ym.mec.common.dal.CustomEnumTypeHandler" />
  10. <result column="content_" property="content" />
  11. <result column="description_" property="description" />
  12. <result column="modify_on_" property="modifyOn" />
  13. <result column="url_" property="url" />
  14. </resultMap>
  15. <sql id="queryCondition">
  16. <where>
  17. <if test="messageType != null">
  18. and message_type_ =
  19. #{messageType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
  20. </if>
  21. <if test="content != null">
  22. and content_ = #{content,jdbcType=VARCHAR},
  23. </if>
  24. <if test="description != null">
  25. and description_ = #{description,jdbcType=TIMESTAMP}
  26. </if>
  27. </where>
  28. </sql>
  29. <!-- 根据主键查询一条记录 -->
  30. <select id="get" resultMap="SysMessageConfig">
  31. SELECT * FROM
  32. sys_message_config WHERE id_ = #{id}
  33. </select>
  34. <!-- 全查询 -->
  35. <select id="findAll" resultMap="SysMessageConfig">
  36. SELECT * FROM sys_message_config
  37. ORDER BY id_
  38. </select>
  39. <!-- 向数据库增加一条记录 -->
  40. <insert id="insert" parameterType="com.ym.mec.biz.dal.entity.SysMessageConfig"
  41. useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  42. <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
  43. AS ID FROM DUAL </selectKey> -->
  44. INSERT INTO sys_message_config
  45. (id_,message_type_,content_,description_,modify_on_,url_)
  46. VALUES(#{id},#{messageType},#{content},#{description},#{modifyOn},#{url})
  47. </insert>
  48. <!-- 根据主键查询一条记录 -->
  49. <update id="update" parameterType="com.ym.mec.biz.dal.entity.SysMessageConfig">
  50. UPDATE sys_message_config
  51. <set>
  52. <if test="modifyOn != null">
  53. modify_on_ = #{modifyOn},
  54. </if>
  55. <if test="messageType != null">
  56. message_type_ = #{messageType},
  57. </if>
  58. <if test="id != null">
  59. id_ = #{id},
  60. </if>
  61. <if test="url != null">
  62. url_ = #{url},
  63. </if>
  64. <if test="content != null">
  65. content_ = #{content},
  66. </if>
  67. <if test="description != null">
  68. description_ = #{description},
  69. </if>
  70. </set>
  71. WHERE id_ = #{id}
  72. </update>
  73. <!-- 根据主键删除一条记录 -->
  74. <delete id="delete">
  75. DELETE FROM sys_message_config WHERE id_ =
  76. #{id}
  77. </delete>
  78. <!-- 分页查询 -->
  79. <select id="queryPage" resultMap="SysMessageConfig"
  80. parameterType="map">
  81. select * from sys_message_config
  82. <include refid="queryCondition" />
  83. order by update_time_ desc
  84. <include refid="global.limit" />
  85. </select>
  86. <!-- 查询当前表的总记录数 -->
  87. <select id="queryCount" resultType="int">
  88. select count(*) from sys_message_config
  89. <include refid="queryCondition" />
  90. </select>
  91. <select id="queryByType" resultMap="SysMessageConfig">
  92. select *
  93. from xjd_message_config
  94. where message_type_ = #{messageType,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler}
  95. </select>
  96. </mapper>