SysConfigMapper.xml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  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.keao.edu.user.dao.SysConfigDao">
  5. <resultMap type="com.keao.edu.common.entity.SysConfig" id="SysConfig">
  6. <result column="id_" property="id" />
  7. <result column="param_name_" property="paramName" />
  8. <result column="paran_value_" property="paranValue" />
  9. <result column="description_" property="description" />
  10. <result column="create_on_" property="createOn" />
  11. <result column="modify_on_" property="modifyOn" />
  12. <result column="group_" property="group" />
  13. </resultMap>
  14. <!-- 根据主键查询一条记录 -->
  15. <select id="get" resultMap="SysConfig">
  16. SELECT * FROM sys_config WHERE id_ = #{id}
  17. </select>
  18. <!-- 全查询 -->
  19. <select id="findAll" resultMap="SysConfig">
  20. SELECT * FROM sys_config where 1=1
  21. <if test="group != null">
  22. and group_ = #{group}
  23. </if>
  24. ORDER BY id_
  25. </select>
  26. <!-- 向数据库增加一条记录 -->
  27. <insert id="insert" parameterType="com.keao.edu.common.entity.SysConfig"
  28. useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  29. <!-- <selectKey resultClass="int" keyProperty="id" > SELECT SEQ_WSDEFINITION_ID.nextval
  30. AS ID FROM DUAL </selectKey> -->
  31. INSERT INTO sys_config
  32. (id_,param_name_,paran_value_,description_,create_on_,modify_on_,group_)
  33. VALUES(#{id},#{paramName},#{paranValue},#{description},#{createOn},#{modifyOn},#{group})
  34. </insert>
  35. <!-- 根据主键查询一条记录 -->
  36. <update id="update" parameterType="com.keao.edu.common.entity.SysConfig">
  37. UPDATE sys_config
  38. <set>
  39. <if test="modifyOn != null">
  40. modify_on_ = #{modifyOn},
  41. </if>
  42. <if test="paranValue != null">
  43. paran_value_ = #{paranValue},
  44. </if>
  45. <if test="description != null">
  46. description_ = #{description},
  47. </if>
  48. <if test="paramName != null">
  49. param_name_ = #{paramName},
  50. </if>
  51. <if test="group != null">
  52. group_ = #{group}
  53. </if>
  54. </set>
  55. WHERE id_ = #{id}
  56. </update>
  57. <!-- 根据主键删除一条记录 -->
  58. <delete id="delete">
  59. DELETE FROM sys_config WHERE id_ = #{id}
  60. </delete>
  61. <!-- 分页查询 -->
  62. <select id="queryPage" resultMap="SysConfig" parameterType="map">
  63. SELECT * FROM sys_config ORDER BY id_
  64. <include refid="global.limit" />
  65. </select>
  66. <!-- 查询当前表的总记录数 -->
  67. <select id="queryCount" resultType="int">
  68. SELECT COUNT(*) FROM sys_config
  69. </select>
  70. <select id="findByParamName" resultMap="SysConfig">
  71. SELECT * FROM sys_config WHERE param_name_ = #{paramName}
  72. </select>
  73. <select id="findConfigValue" resultType="java.lang.String">
  74. SELECT paran_value_ FROM sys_config WHERE param_name_ = #{paramName}
  75. </select>
  76. </mapper>