123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135 |
- <?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.room.RoomGameConfigMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
- <id column="id" property="id" jdbcType="INTEGER" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="start" property="start" jdbcType="VARCHAR" />
- <result column="end" property="end" jdbcType="VARCHAR" />
- <result column="status" property="status" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="admin_id" property="adminId" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, start, end, status, create_time, admin_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
- select
- <include refid="Base_Column_List" />
- from room_game_config
- where id = #{id,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- insert into room_game_config (id, uid, start,
- end, status, create_time,
- admin_id)
- values (#{id,jdbcType=INTEGER}, #{uid,jdbcType=BIGINT}, #{start,jdbcType=VARCHAR},
- #{end,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP},
- #{adminId,jdbcType=INTEGER})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- insert into room_game_config
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- id,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="start != null" >
- start,
- </if>
- <if test="end != null" >
- end,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="adminId != null" >
- admin_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="id != null" >
- #{id,jdbcType=INTEGER},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="start != null" >
- #{start,jdbcType=VARCHAR},
- </if>
- <if test="end != null" >
- #{end,jdbcType=VARCHAR},
- </if>
- <if test="status != null" >
- #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- #{adminId,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
- update room_game_config
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="start != null" >
- start = #{start,jdbcType=VARCHAR},
- </if>
- <if test="end != null" >
- end = #{end,jdbcType=VARCHAR},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomGameConfig" >
- update room_game_config
- set uid = #{uid,jdbcType=BIGINT},
- start = #{start,jdbcType=VARCHAR},
- end = #{end,jdbcType=VARCHAR},
- status = #{status,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- admin_id = #{adminId,jdbcType=INTEGER}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
- delete from room_game_config
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <select id="selectByRoomGameConfigs" resultType="com.juxiao.xchat.module.xbd.vo.RoomGameConfigVO">
- select rgc.id,rgc.uid,rgc.start,rgc.end,rgc.status,rgc.create_time as createTime,u.erban_no as erbanNo, u.nick,rgc.admin_id as adminId
- from room_game_config rgc
- inner join users u on rgc.uid = u.uid
- where 1 =1
- <if test="erBanNo != null">
- and u.erban_no = #{erBanNo}
- </if>
- ORDER BY rgc.status asc , rgc.create_time DESC
- </select>
- </mapper>
|