UsersCharmMapper.xml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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.UsersCharmMapper">
  4. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UsersCharm" >
  5. <id column="id" property="id" jdbcType="INTEGER" />
  6. <result column="uid" property="uid" jdbcType="INTEGER" />
  7. <result column="charm" property="charm" jdbcType="INTEGER" />
  8. <result column="admin_id" property="adminId" jdbcType="INTEGER" />
  9. <result column="create_time" property="createTime" jdbcType="VARCHAR" />
  10. </resultMap>
  11. <sql id="Base_Column_List" >
  12. id, uid, charm, admin_id, create_time
  13. </sql>
  14. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
  15. select
  16. <include refid="Base_Column_List" />
  17. from users_charm
  18. where id = #{id,jdbcType=INTEGER}
  19. </select>
  20. <select id="selectUsersCharmByPage" resultType="com.juxiao.xchat.module.xbd.vo.UsersCharmVO">
  21. select id, uid, charm, admin_id as adminId, create_time as createTime
  22. from users_charm
  23. where 1 = 1
  24. <if test="erBanNo != null">
  25. and uid = #{erBanNo}
  26. </if>
  27. <if test="startTime != null and startTime != '' and endTime != null and endTime != ''">
  28. and create_time between #{startTime} and #{endTime}
  29. </if>
  30. order by create_time desc
  31. </select>
  32. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersCharm" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  33. insert into users_charm (id, uid, charm,
  34. admin_id, create_time)
  35. values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=INTEGER}, #{charm,jdbcType=INTEGER},
  36. #{adminId,jdbcType=INTEGER}, #{createTime,jdbcType=VARCHAR})
  37. </insert>
  38. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersCharm" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  39. insert into users_charm
  40. <trim prefix="(" suffix=")" suffixOverrides="," >
  41. <if test="id != null" >
  42. id,
  43. </if>
  44. <if test="uid != null" >
  45. uid,
  46. </if>
  47. <if test="charm != null" >
  48. charm,
  49. </if>
  50. <if test="adminId != null" >
  51. admin_id,
  52. </if>
  53. <if test="createTime != null" >
  54. create_time,
  55. </if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides="," >
  58. <if test="id != null" >
  59. #{id,jdbcType=INTEGER},
  60. </if>
  61. <if test="uid != null" >
  62. #{uid,jdbcType=INTEGER},
  63. </if>
  64. <if test="charm != null" >
  65. #{charm,jdbcType=INTEGER},
  66. </if>
  67. <if test="adminId != null" >
  68. #{adminId,jdbcType=INTEGER},
  69. </if>
  70. <if test="createTime != null" >
  71. #{createTime,jdbcType=VARCHAR},
  72. </if>
  73. </trim>
  74. </insert>
  75. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersCharm" >
  76. update users_charm
  77. <set >
  78. <if test="uid != null" >
  79. uid = #{uid,jdbcType=INTEGER},
  80. </if>
  81. <if test="charm != null" >
  82. charm = #{charm,jdbcType=INTEGER},
  83. </if>
  84. <if test="adminId != null" >
  85. admin_id = #{adminId,jdbcType=INTEGER},
  86. </if>
  87. <if test="createTime != null" >
  88. create_time = #{createTime,jdbcType=VARCHAR},
  89. </if>
  90. </set>
  91. where id = #{id,jdbcType=INTEGER}
  92. </update>
  93. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersCharm" >
  94. update users_charm
  95. set uid = #{uid,jdbcType=INTEGER},
  96. charm = #{charm,jdbcType=INTEGER},
  97. admin_id = #{adminId,jdbcType=INTEGER},
  98. create_time = #{createTime,jdbcType=VARCHAR}
  99. where id = #{id,jdbcType=INTEGER}
  100. </update>
  101. <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
  102. delete from users_charm
  103. where id = #{id,jdbcType=INTEGER}
  104. </delete>
  105. <select id="selectByUid" resultMap="BaseResultMap">
  106. select
  107. <include refid="Base_Column_List" />
  108. from users_charm
  109. where uid = #{uid}
  110. </select>
  111. </mapper>