UserDrawWhitelistMapper.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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.juxiao.xchat.module.xbd.mapper.users.UserDrawWhitelistMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserDrawWhitelist" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="BIGINT" />
  7. <result column="admin_id" property="adminId" jdbcType="INTEGER" />
  8. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  9. </resultMap>
  10. <sql id="Base_Column_List" >
  11. id, uid, admin_id, create_time
  12. </sql>
  13. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  14. select
  15. <include refid="Base_Column_List" />
  16. from user_draw_whitelist
  17. where id = #{id,jdbcType=INTEGER}
  18. </select>
  19. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawWhitelist" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  20. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  21. SELECT LAST_INSERT_ID()
  22. </selectKey>
  23. insert into user_draw_whitelist (uid, admin_id, create_time
  24. )
  25. values (#{uid,jdbcType=BIGINT}, #{adminId,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}
  26. )
  27. </insert>
  28. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawWhitelist" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
  29. <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
  30. SELECT LAST_INSERT_ID()
  31. </selectKey>
  32. insert into user_draw_whitelist
  33. <trim prefix="(" suffix=")" suffixOverrides="," >
  34. <if test="uid != null" >
  35. uid,
  36. </if>
  37. <if test="adminId != null" >
  38. admin_id,
  39. </if>
  40. <if test="createTime != null" >
  41. create_time,
  42. </if>
  43. </trim>
  44. <trim prefix="values (" suffix=")" suffixOverrides="," >
  45. <if test="uid != null" >
  46. #{uid,jdbcType=BIGINT},
  47. </if>
  48. <if test="adminId != null" >
  49. #{adminId,jdbcType=INTEGER},
  50. </if>
  51. <if test="createTime != null" >
  52. #{createTime,jdbcType=TIMESTAMP},
  53. </if>
  54. </trim>
  55. </insert>
  56. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawWhitelist" >
  57. update user_draw_whitelist
  58. <set >
  59. <if test="uid != null" >
  60. uid = #{uid,jdbcType=BIGINT},
  61. </if>
  62. <if test="adminId != null" >
  63. admin_id = #{adminId,jdbcType=INTEGER},
  64. </if>
  65. <if test="createTime != null" >
  66. create_time = #{createTime,jdbcType=TIMESTAMP},
  67. </if>
  68. </set>
  69. where id = #{id,jdbcType=INTEGER}
  70. </update>
  71. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawWhitelist" >
  72. update user_draw_whitelist
  73. set uid = #{uid,jdbcType=BIGINT},
  74. admin_id = #{adminId,jdbcType=INTEGER},
  75. create_time = #{createTime,jdbcType=TIMESTAMP}
  76. where id = #{id,jdbcType=INTEGER}
  77. </update>
  78. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  79. delete from user_draw_whitelist
  80. where id = #{id,jdbcType=INTEGER}
  81. </delete>
  82. <select id="selectByUids" resultType="java.lang.Long">
  83. select uid from user_draw_whitelist
  84. where 1=1
  85. <if test="uid != null">
  86. and uid = #{uid}
  87. </if>
  88. </select>
  89. <select id="selectByUid" resultMap="BaseResultMap">
  90. select
  91. <include refid="Base_Column_List" />
  92. from user_draw_whitelist
  93. where uid = #{uid}
  94. </select>
  95. </mapper>