PtokenMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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. <mapper namespace="com.book.dao.cps.mapper.PtokenMapper">
  4. <resultMap id="BaseResultMap" type="com.book.dao.cps.pojo.Ptoken">
  5. <id column="id" jdbcType="INTEGER" property="id" />
  6. <result column="platform_id" jdbcType="INTEGER" property="platformId" />
  7. <result column="refresh_token" jdbcType="VARCHAR" property="refreshToken" />
  8. <result column="admin_id" jdbcType="VARCHAR" property="adminId" />
  9. <result column="createtime" jdbcType="INTEGER" property="createtime" />
  10. <result column="updatetime" jdbcType="INTEGER" property="updatetime" />
  11. </resultMap>
  12. <sql id="Base_Column_List">
  13. id, platform_id, refresh_token, admin_id, createtime, updatetime
  14. </sql>
  15. <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
  16. select
  17. <include refid="Base_Column_List" />
  18. from ptoken
  19. where id = #{id,jdbcType=INTEGER}
  20. </select>
  21. <select id="selectAll" resultType="com.book.dao.cps.pojo.Ptoken">
  22. select * from ptoken;
  23. </select>
  24. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
  25. delete from ptoken
  26. where id = #{id,jdbcType=INTEGER}
  27. </delete>
  28. <insert id="insert" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.Ptoken" useGeneratedKeys="true">
  29. insert into ptoken (platform_id, refresh_token, admin_id,
  30. createtime, updatetime)
  31. values (#{platformId,jdbcType=INTEGER}, #{refreshToken,jdbcType=VARCHAR}, #{adminId,jdbcType=VARCHAR},
  32. #{createtime,jdbcType=INTEGER}, #{updatetime,jdbcType=INTEGER})
  33. </insert>
  34. <insert id="insertSelective" keyColumn="id" keyProperty="id" parameterType="com.book.dao.cps.pojo.Ptoken" useGeneratedKeys="true">
  35. insert into ptoken
  36. <trim prefix="(" suffix=")" suffixOverrides=",">
  37. <if test="platformId != null">
  38. platform_id,
  39. </if>
  40. <if test="refreshToken != null">
  41. refresh_token,
  42. </if>
  43. <if test="adminId != null">
  44. admin_id,
  45. </if>
  46. <if test="createtime != null">
  47. createtime,
  48. </if>
  49. <if test="updatetime != null">
  50. updatetime,
  51. </if>
  52. </trim>
  53. <trim prefix="values (" suffix=")" suffixOverrides=",">
  54. <if test="platformId != null">
  55. #{platformId,jdbcType=INTEGER},
  56. </if>
  57. <if test="refreshToken != null">
  58. #{refreshToken,jdbcType=VARCHAR},
  59. </if>
  60. <if test="adminId != null">
  61. #{adminId,jdbcType=VARCHAR},
  62. </if>
  63. <if test="createtime != null">
  64. #{createtime,jdbcType=INTEGER},
  65. </if>
  66. <if test="updatetime != null">
  67. #{updatetime,jdbcType=INTEGER},
  68. </if>
  69. </trim>
  70. </insert>
  71. <update id="updateByPrimaryKeySelective" parameterType="com.book.dao.cps.pojo.Ptoken">
  72. update ptoken
  73. <set>
  74. <if test="platformId != null">
  75. platform_id = #{platformId,jdbcType=INTEGER},
  76. </if>
  77. <if test="refreshToken != null">
  78. refresh_token = #{refreshToken,jdbcType=VARCHAR},
  79. </if>
  80. <if test="adminId != null">
  81. admin_id = #{adminId,jdbcType=VARCHAR},
  82. </if>
  83. <if test="createtime != null">
  84. createtime = #{createtime,jdbcType=INTEGER},
  85. </if>
  86. <if test="updatetime != null">
  87. updatetime = #{updatetime,jdbcType=INTEGER},
  88. </if>
  89. </set>
  90. where id = #{id,jdbcType=INTEGER}
  91. </update>
  92. <update id="updateByPrimaryKey" parameterType="com.book.dao.cps.pojo.Ptoken">
  93. update ptoken
  94. set platform_id = #{platformId,jdbcType=INTEGER},
  95. refresh_token = #{refreshToken,jdbcType=VARCHAR},
  96. admin_id = #{adminId,jdbcType=VARCHAR},
  97. createtime = #{createtime,jdbcType=INTEGER},
  98. updatetime = #{updatetime,jdbcType=INTEGER}
  99. where id = #{id,jdbcType=INTEGER}
  100. </update>
  101. </mapper>