123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- <?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.RoomMonitorConfigMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorConfig">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="uid" property="uid" jdbcType="BIGINT"/>
- <result column="room" property="room" jdbcType="BIGINT"/>
- <result column="state" property="state" jdbcType="INTEGER"/>
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
- <result column="request_id" property="requestId" jdbcType="VARCHAR"/>
- <result column="erban_no" property="erBanNo" jdbcType="BIGINT"/>
- <result column="title" property="title" jdbcType="VARCHAR"/>
- </resultMap>
- <sql id="Base_Column_List">
- r.id, r.uid, r.room, r.state, r.create_time,r.request_id
- </sql>
- <select id="selectByErbanNo" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List"/>,u.erban_no,r1.title
- from room_monitor_config r
- join users u on r.uid=u.uid
- left join room r1 on r.room=r1.room_id
- <where>
- <if test="erBanNo != null ">
- and u.erban_no = #{erBanNo,jdbcType=INTEGER}
- </if>
- </where>
- order by r.state desc,r.create_time
- </select>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer">
- select
- <include refid="Base_Column_List"/>
- from room_monitor_config r
- where id = #{id,jdbcType=INTEGER}
- </select>
- <select id="selectByRequestId" resultMap="BaseResultMap" >
- select
- <include refid="Base_Column_List"/>
- from room_monitor_config r
- where request_id = #{requestId,jdbcType=VARCHAR}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from room_monitor_config
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorConfig">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into room_monitor_config (uid, room, state,
- create_time,request_id)
- values (#{uid,jdbcType=BIGINT}, #{room,jdbcType=BIGINT}, #{state,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP},#{requestId,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorConfig">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into room_monitor_config
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="uid != null">
- uid,
- </if>
- <if test="room != null">
- room,
- </if>
- <if test="state != null">
- state,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="requestId != null">
- request_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="uid != null">
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="room != null">
- #{room,jdbcType=BIGINT},
- </if>
- <if test="state != null">
- #{state,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="requestId != null">
- #{requestId,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorConfig">
- update room_monitor_config
- <set>
- <if test="uid != null">
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="room != null">
- room = #{room,jdbcType=BIGINT},
- </if>
- <if test="state != null">
- state = #{state,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="requestId != null">
- request_id = #{requestId,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.room.RoomMonitorConfig">
- update room_monitor_config
- set uid = #{uid,jdbcType=BIGINT},
- room = #{room,jdbcType=BIGINT},
- state = #{state,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- request_id = #{requestId,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- </mapper>
|