SysOauthClientDetailsMapper.xml 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. 这个文件是自动生成的。
  5. 不要修改此文件。所有改动将在下次重新自动生成时丢失。
  6. -->
  7. <mapper namespace="com.yonge.cooleshow.auth.dal.dao.SysOauthClientDetailsDao">
  8. <resultMap type="com.yonge.cooleshow.auth.api.entity.SysOauthClientDetails" id="SysOauthClientDetails">
  9. <result column="id_" property="id"/>
  10. <result column="resource_ids_" property="resourceIds"/>
  11. <result column="client_secret_" property="clientSecret"/>
  12. <result column="scope_" property="scope"/>
  13. <result column="authorized_grant_types_" property="authorizedGrantTypes"/>
  14. <result column="web_server_redirect_uri_" property="webServerRedirectUri"/>
  15. <result column="authorities_" property="authorities"/>
  16. <result column="access_token_validity_" property="accessTokenValidity"/>
  17. <result column="refresh_token_validity_" property="refreshTokenValidity"/>
  18. <result column="additional_information_" property="additionalInformation"/>
  19. <result column="autoapprove_" property="autoapprove"/>
  20. </resultMap>
  21. <!-- 根据主键查询一条记录 -->
  22. <select id="get" resultMap="SysOauthClientDetails">
  23. SELECT * FROM sys_oauth_client_details WHERE id_ = #{id}
  24. </select>
  25. <!-- 全查询 -->
  26. <select id="findAll" resultMap="SysOauthClientDetails">
  27. SELECT * FROM sys_oauth_client_details ORDER BY id_
  28. </select>
  29. <!-- 向数据库增加一条记录 -->
  30. <insert id="insert" parameterType="com.yonge.cooleshow.auth.api.entity.SysOauthClientDetails" useGeneratedKeys="true"
  31. keyColumn="id" keyProperty="id">
  32. <!--
  33. <selectKey resultClass="int" keyProperty="id" >
  34. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  35. </selectKey>
  36. -->
  37. INSERT INTO sys_oauth_client_details
  38. (id_,resource_ids_,client_secret_,scope_,authorized_grant_types_,web_server_redirect_uri_,authorities_,access_token_validity_,refresh_token_validity_,additional_information_,autoapprove_)
  39. VALUES(#{id},#{resourceIds},#{clientSecret},#{scope},#{authorizedGrantTypes},#{webServerRedirectUri},#{authorities},#{accessTokenValidity},#{refreshTokenValidity},#{additionalInformation},#{autoapprove})
  40. </insert>
  41. <!-- 根据主键查询一条记录 -->
  42. <update id="update" parameterType="com.yonge.cooleshow.auth.api.entity.SysOauthClientDetails">
  43. UPDATE sys_oauth_client_details
  44. <set>
  45. <if test="accessTokenValidity != null">
  46. access_token_validity_ = #{accessTokenValidity},
  47. </if>
  48. <if test="resourceIds != null">
  49. resource_ids_ = #{resourceIds},
  50. </if>
  51. <if test="refreshTokenValidity != null">
  52. refresh_token_validity_ = #{refreshTokenValidity},
  53. </if>
  54. <if test="additionalInformation != null">
  55. additional_information_ = #{additionalInformation},
  56. </if>
  57. <if test="clientSecret != null">
  58. client_secret_ = #{clientSecret},
  59. </if>
  60. <if test="webServerRedirectUri != null">
  61. web_server_redirect_uri_ = #{webServerRedirectUri},
  62. </if>
  63. <if test="authorizedGrantTypes != null">
  64. authorized_grant_types_ = #{authorizedGrantTypes},
  65. </if>
  66. <if test="authorities != null">
  67. authorities_ = #{authorities},
  68. </if>
  69. <if test="scope != null">
  70. scope_ = #{scope},
  71. </if>
  72. <if test="autoapprove != null">
  73. autoapprove_ = #{autoapprove},
  74. </if>
  75. </set>
  76. WHERE id_ = #{id}
  77. </update>
  78. <!-- 根据主键删除一条记录 -->
  79. <delete id="delete">
  80. DELETE FROM sys_oauth_client_details WHERE id_ = #{id}
  81. </delete>
  82. <!-- 分页查询 -->
  83. <select id="queryPage" resultMap="SysOauthClientDetails" parameterType="map">
  84. SELECT * FROM sys_oauth_client_details ORDER BY id_
  85. <include refid="global.limit"/>
  86. </select>
  87. <!-- 查询当前表的总记录数 -->
  88. <select id="queryCount" resultType="int">
  89. SELECT COUNT(*) FROM sys_oauth_client_details
  90. </select>
  91. </mapper>