SysOauthClientDetailsMapper.xml 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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.ym.mec.auth.dal.dao.SysOauthClientDetailsDao">
  8. <resultMap type="com.ym.mec.auth.api.entity.SysOauthClientDetails" id="SysOauthClientDetails">
  9. <result column="client_id" property="clientId" />
  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 client_id = #{clientId}
  24. </select>
  25. <!-- 全查询 -->
  26. <select id="findAll" resultMap="SysOauthClientDetails">
  27. SELECT * FROM sys_oauth_client_details ORDER BY client_id
  28. </select>
  29. <!-- 向数据库增加一条记录 -->
  30. <insert id="insert" parameterType="com.ym.mec.auth.api.entity.SysOauthClientDetails" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  31. <!--
  32. <selectKey resultClass="int" keyProperty="id" >
  33. SELECT SEQ_WSDEFINITION_ID.nextval AS ID FROM DUAL
  34. </selectKey>
  35. -->
  36. INSERT INTO sys_oauth_client_details (client_id,resource_ids,client_secret,scope,authorized_grant_types,web_server_redirect_uri,authorities,access_token_validity,refresh_token_validity,additional_information,autoapprove) VALUES(#{clientId},#{resourceIds},#{clientSecret},#{scope},#{authorizedGrantTypes},#{webServerRedirectUri},#{authorities},#{accessTokenValidity},#{refreshTokenValidity},#{additionalInformation},#{autoapprove})
  37. </insert>
  38. <!-- 根据主键查询一条记录 -->
  39. <update id="update" parameterType="com.ym.mec.auth.api.entity.SysOauthClientDetails">
  40. UPDATE sys_oauth_client_details SET additional_information = #{additionalInformation},access_token_validity = #{accessTokenValidity},autoapprove = #{autoapprove},scope = #{scope},web_server_redirect_uri = #{webServerRedirectUri},authorized_grant_types = #{authorizedGrantTypes},client_secret = #{clientSecret},resource_ids = #{resourceIds},client_id = #{clientId},authorities = #{authorities},refresh_token_validity = #{refreshTokenValidity} WHERE client_id = #{clientId}
  41. </update>
  42. <!-- 根据主键删除一条记录 -->
  43. <delete id="delete" >
  44. DELETE FROM sys_oauth_client_details WHERE client_id = #{clientId}
  45. </delete>
  46. <!-- 分页查询 -->
  47. <select id="queryPage" resultMap="SysOauthClientDetails" parameterType="map">
  48. SELECT * FROM sys_oauth_client_details ORDER BY client_id <include refid="global.limit"/>
  49. </select>
  50. <!-- 查询当前表的总记录数 -->
  51. <select id="queryCount" resultType="int">
  52. SELECT COUNT(*) FROM sys_oauth_client_details
  53. </select>
  54. </mapper>