123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE mapper
- PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
- <mapper namespace="com.juxiao.xchat.module.xbd.mapper.users.UsersMiningMustMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="status" property="status" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="gift_id" property="giftId" jdbcType="INTEGER" />
- <result column="num" property="num" jdbcType="INTEGER" />
- <result column="admin_id" property="adminId" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, status, create_time, gift_id, num, admin_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from users_mining_must
- where id = #{id,jdbcType=BIGINT}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- insert into users_mining_must (id, uid, status,
- create_time, gift_id, num,
- admin_id)
- values (#{id,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, #{status,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{giftId,jdbcType=INTEGER}, #{num,jdbcType=INTEGER},
- #{adminId,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- insert into users_mining_must
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="giftId != null" >
- gift_id,
- </if>
- <if test="num != null" >
- num,
- </if>
- <if test="adminId != null" >
- admin_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=BIGINT},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="status != null" >
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="giftId != null" >
- #{giftId,jdbcType=INTEGER},
- </if>
- <if test="num != null" >
- #{num,jdbcType=INTEGER},
- </if>
- <if test="adminId != null" >
- #{adminId,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
- update users_mining_must
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="giftId != null" >
- gift_id = #{giftId,jdbcType=INTEGER},
- </if>
- <if test="num != null" >
- num = #{num,jdbcType=INTEGER},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust" >
- update users_mining_must
- set uid = #{uid,jdbcType=BIGINT},
- status = #{status,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- gift_id = #{giftId,jdbcType=INTEGER},
- num = #{num,jdbcType=INTEGER},
- admin_id = #{adminId,jdbcType=INTEGER}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from users_mining_must
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <select id="selectByUid" resultType="com.juxiao.xchat.module.xbd.domain.users.UsersMiningMust">
- select id, uid, status, create_time
- from users_mining_must
- where uid = #{uid} and status = #{status}
- </select>
- <select id="selectUsersMiningMustByList" resultType="com.juxiao.xchat.module.xbd.vo.UsersMiningMustVO">
- 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
- from users_mining_must umm
- inner join users u on umm.uid = u.uid
- left join gift g on g.gift_id = umm.gift_id
- left join sys_user su on umm.admin_id = su.user_id
- where 1 = 1
- <if test="erBanNo != null">
- and u.erban_no = #{erBanNo}
- </if>
- <if test="adminName != null and adminName != ''">
- and su.user_name = #{adminName}
- </if>
- <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
- and umm.create_time between #{beginTime} and #{endTime}
- </if>
- order by umm.create_time desc
- </select>
- </mapper>
|