UserDrawPrettyErBanNoMapper.xml 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?xml version="1.0" encoding="UTF-8" ?>
  2. <!DOCTYPE mapper
  3. PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
  4. "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
  5. <mapper namespace="com.juxiao.xchat.module.xbd.mapper.users.UserDrawPrettyErbanNoMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
  7. <id column="pretty_erban_no" property="prettyErbanNo" jdbcType="BIGINT" />
  8. <result column="type" property="type" jdbcType="TINYINT" />
  9. <result column="use_status" property="useStatus" jdbcType="TINYINT" />
  10. <result column="use_erban_no" property="useErbanNo" jdbcType="BIGINT" />
  11. <result column="seq" property="seq" jdbcType="TINYINT" />
  12. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  13. <result column="status" property="status" jdbcType="TINYINT" />
  14. <result column="uid" property="uid" jdbcType="BIGINT" />
  15. </resultMap>
  16. <sql id="Base_Column_List" >
  17. pretty_erban_no, type, use_status, use_erban_no, seq, create_time,uid,status
  18. </sql>
  19. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  20. select
  21. <include refid="Base_Column_List" />
  22. from user_draw_pretty_erban_no
  23. where pretty_erban_no = #{prettyErBanNo}
  24. </select>
  25. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
  26. insert into user_draw_pretty_erban_no (pretty_erban_no, type, use_status,
  27. use_erban_no, seq, create_time,uid,status
  28. )
  29. values (#{prettyErbanNo,jdbcType=BIGINT}, #{type,jdbcType=TINYINT}, #{useStatus,jdbcType=TINYINT},
  30. #{useErbanNo,jdbcType=BIGINT}, #{seq,jdbcType=TINYINT}, #{createTime,jdbcType=TIMESTAMP},
  31. #{uid,jdbcType=BIGINT},#{status,jdbcType=TINYINT}
  32. )
  33. </insert>
  34. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
  35. insert into user_draw_pretty_erban_no
  36. <trim prefix="(" suffix=")" suffixOverrides="," >
  37. <if test="prettyErbanNo != null" >
  38. pretty_erban_no,
  39. </if>
  40. <if test="type != null" >
  41. type,
  42. </if>
  43. <if test="useStatus != null" >
  44. use_status,
  45. </if>
  46. <if test="useErbanNo != null" >
  47. use_erban_no,
  48. </if>
  49. <if test="seq != null" >
  50. seq,
  51. </if>
  52. <if test="createTime != null" >
  53. create_time,
  54. </if>
  55. <if test="uid != null" >
  56. uid,
  57. </if>
  58. <if test="status != null" >
  59. status,
  60. </if>
  61. </trim>
  62. <trim prefix="values (" suffix=")" suffixOverrides="," >
  63. <if test="prettyErbanNo != null" >
  64. #{prettyErbanNo,jdbcType=BIGINT},
  65. </if>
  66. <if test="type != null" >
  67. #{type,jdbcType=TINYINT},
  68. </if>
  69. <if test="useStatus != null" >
  70. #{useStatus,jdbcType=TINYINT},
  71. </if>
  72. <if test="useErbanNo != null" >
  73. #{useErbanNo,jdbcType=BIGINT},
  74. </if>
  75. <if test="seq != null" >
  76. #{seq,jdbcType=TINYINT},
  77. </if>
  78. <if test="createTime != null" >
  79. #{createTime,jdbcType=TIMESTAMP},
  80. </if>
  81. <if test="uid != null" >
  82. #{uid,jdbcType=BIGINT},
  83. </if>
  84. <if test="status != null" >
  85. #{status,jdbcType=TINYINT},
  86. </if>
  87. </trim>
  88. </insert>
  89. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
  90. update user_draw_pretty_erban_no
  91. <set >
  92. <if test="type != null" >
  93. type = #{type,jdbcType=TINYINT},
  94. </if>
  95. <if test="useStatus != null" >
  96. use_status = #{useStatus,jdbcType=TINYINT},
  97. </if>
  98. <if test="useErbanNo != null" >
  99. use_erban_no = #{useErbanNo,jdbcType=BIGINT},
  100. </if>
  101. <if test="seq != null" >
  102. seq = #{seq,jdbcType=TINYINT},
  103. </if>
  104. <if test="createTime != null" >
  105. create_time = #{createTime,jdbcType=TIMESTAMP},
  106. </if>
  107. <if test="uid != null" >
  108. uid = #{uid,jdbcType=BIGINT},
  109. </if>
  110. <if test="status != null" >
  111. status = #{status,jdbcType=TINYINT},
  112. </if>
  113. </set>
  114. where pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT}
  115. </update>
  116. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserDrawPrettyErbanNo" >
  117. update user_draw_pretty_erban_no
  118. set type = #{type,jdbcType=TINYINT},
  119. use_status = #{useStatus,jdbcType=TINYINT},
  120. use_erban_no = #{useErbanNo,jdbcType=BIGINT},
  121. seq = #{seq,jdbcType=TINYINT},
  122. create_time = #{createTime,jdbcType=TIMESTAMP},
  123. uid = #{useErbanNo,jdbcType=BIGINT},
  124. status = #{useStatus,jdbcType=TINYINT}
  125. where pretty_erban_no = #{prettyErbanNo,jdbcType=BIGINT}
  126. </update>
  127. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  128. delete from user_draw_pretty_erban_no
  129. where pretty_erban_no = #{prettyErBanNo}
  130. </delete>
  131. <select id="selectUserPrettyNoByList" resultType="com.juxiao.xchat.module.xbd.vo.UserPrettyNoVO">
  132. SELECT p.pretty_erban_no as prettyErbanNo,p.type as type, p.use_status as useStatus,p.create_time as createTime,p.use_erban_no as erbanNo,
  133. u.uid as uid,u.has_pretty_erban_no as hasPrettyErbanNo,u.nick as nick, p.seq,p.uid,p.status
  134. FROM user_draw_pretty_erban_no p LEFT JOIN users u ON p.pretty_erban_no=u.erban_no
  135. <where>
  136. <if test="prettyErBanNo!=null">
  137. p.pretty_erban_no=#{prettyErBanNo}
  138. </if>
  139. <if test="beginDate!=null">
  140. AND p.create_time &gt;= #{beginDate}
  141. </if>
  142. <if test="endDate!=null">
  143. AND p.create_time &lt;= #{endDate}
  144. </if>
  145. <if test="status!=null">
  146. AND p.status = #{status}
  147. </if>
  148. <if test="type!=null">
  149. AND p.type = #{type}
  150. </if>
  151. </where>
  152. order by p.use_status asc, p.seq asc, p.create_time asc
  153. </select>
  154. </mapper>