UsersMiningMustMapper.xml 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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.UsersMiningMustMapper">
  6. <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
  7. <id column="id" property="id" jdbcType="BIGINT" />
  8. <result column="uid" property="uid" jdbcType="BIGINT" />
  9. <result column="status" property="status" jdbcType="INTEGER" />
  10. <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
  11. <result column="gift_id" property="giftId" jdbcType="INTEGER" />
  12. <result column="num" property="num" jdbcType="INTEGER" />
  13. <result column="admin_id" property="adminId" jdbcType="INTEGER" />
  14. </resultMap>
  15. <sql id="Base_Column_List" >
  16. id, uid, status, create_time, gift_id, num, admin_id
  17. </sql>
  18. <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
  19. select
  20. <include refid="Base_Column_List" />
  21. from users_mining_must
  22. where id = #{id,jdbcType=BIGINT}
  23. </select>
  24. <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  25. insert into users_mining_must (id, uid, status,
  26. create_time, gift_id, num,
  27. admin_id)
  28. values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, #{status,jdbcType=INTEGER},
  29. #{createTime,jdbcType=TIMESTAMP}, #{giftId,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
  30. #{adminId,jdbcType=INTEGER})
  31. </insert>
  32. <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
  33. insert into users_mining_must
  34. <trim prefix="(" suffix=")" suffixOverrides="," >
  35. <if test="id != null" >
  36. id,
  37. </if>
  38. <if test="uid != null" >
  39. uid,
  40. </if>
  41. <if test="status != null" >
  42. status,
  43. </if>
  44. <if test="createTime != null" >
  45. create_time,
  46. </if>
  47. <if test="giftId != null" >
  48. gift_id,
  49. </if>
  50. <if test="num != null" >
  51. num,
  52. </if>
  53. <if test="adminId != null" >
  54. admin_id,
  55. </if>
  56. </trim>
  57. <trim prefix="values (" suffix=")" suffixOverrides="," >
  58. <if test="id != null" >
  59. #{id,jdbcType=BIGINT},
  60. </if>
  61. <if test="uid != null" >
  62. #{uid,jdbcType=BIGINT},
  63. </if>
  64. <if test="status != null" >
  65. #{status,jdbcType=INTEGER},
  66. </if>
  67. <if test="createTime != null" >
  68. #{createTime,jdbcType=TIMESTAMP},
  69. </if>
  70. <if test="giftId != null" >
  71. #{giftId,jdbcType=INTEGER},
  72. </if>
  73. <if test="num != null" >
  74. #{num,jdbcType=INTEGER},
  75. </if>
  76. <if test="adminId != null" >
  77. #{adminId,jdbcType=INTEGER},
  78. </if>
  79. </trim>
  80. </insert>
  81. <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
  82. update users_mining_must
  83. <set >
  84. <if test="uid != null" >
  85. uid = #{uid,jdbcType=BIGINT},
  86. </if>
  87. <if test="status != null" >
  88. status = #{status,jdbcType=INTEGER},
  89. </if>
  90. <if test="createTime != null" >
  91. create_time = #{createTime,jdbcType=TIMESTAMP},
  92. </if>
  93. <if test="giftId != null" >
  94. gift_id = #{giftId,jdbcType=INTEGER},
  95. </if>
  96. <if test="num != null" >
  97. num = #{num,jdbcType=INTEGER},
  98. </if>
  99. <if test="adminId != null" >
  100. admin_id = #{adminId,jdbcType=INTEGER},
  101. </if>
  102. </set>
  103. where id = #{id,jdbcType=BIGINT}
  104. </update>
  105. <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
  106. update users_mining_must
  107. set uid = #{uid,jdbcType=BIGINT},
  108. status = #{status,jdbcType=INTEGER},
  109. create_time = #{createTime,jdbcType=TIMESTAMP},
  110. gift_id = #{giftId,jdbcType=INTEGER},
  111. num = #{num,jdbcType=INTEGER},
  112. admin_id = #{adminId,jdbcType=INTEGER}
  113. where id = #{id,jdbcType=BIGINT}
  114. </update>
  115. <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
  116. delete from users_mining_must
  117. where id = #{id,jdbcType=BIGINT}
  118. </delete>
  119. <select id="selectByUid" resultType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust">
  120. select id, uid, status, create_time
  121. from users_mining_must
  122. where uid = #{uid} and status = #{status}
  123. </select>
  124. <select id="selectUsersMiningMustByList" resultType="com.juxiao.xchat.module.xbd.vo.UsersMiningMustVO">
  125. select umm.uid,umm.id,umm.create_time as createTime,u.erban_no as erBanNo,u.nick,umm.status,g.gift_id as giftId,g.gift_name as giftName,umm.admin_id as adminId,su.user_name as adminName,g.gold_price as goldPrice
  126. from users_mining_must umm
  127. inner join users u on umm.uid = u.uid
  128. left join gift g on g.gift_id = umm.gift_id
  129. left join sys_user su on umm.admin_id = su.user_id
  130. where 1 = 1
  131. <if test="erBanNo != null">
  132. and u.erban_no = #{erBanNo}
  133. </if>
  134. <if test="adminName != null and adminName != ''">
  135. and su.user_name = #{adminName}
  136. </if>
  137. <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
  138. and umm.create_time between #{beginTime} and #{endTime}
  139. </if>
  140. order by umm.create_time desc
  141. </select>
  142. </mapper>