SysConfigMapper.xml 3.2 KB

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