123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139 |
- <?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.MoraConfigMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.room.MoraConfig" >
- <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 mora_config
- where id = #{id,jdbcType=INTEGER}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.room.MoraConfig" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into mora_config (uid, start, end,
- status, create_time, admin_id
- )
- values (#{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.MoraConfig" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey resultType="java.lang.Integer" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into mora_config
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <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="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.MoraConfig" >
- update mora_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.MoraConfig" >
- update mora_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 mora_config
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <select id="selectByPage" resultType="com.juxiao.xchat.module.xbd.vo.MoraConfVO">
- select mc.id,mc.uid,mc.start,mc.end,mc.status,mc.admin_id as adminId,mc.create_time as createTime,u.erban_no as erbanNo,u.nick
- from mora_config mc
- inner join users u on mc.uid = u.uid
- <if test="erBanNo != null and erBanNo != ''">
- and u.erban_no = #{erBanNo}
- </if>
- ORDER BY mc.create_time DESC
- </select>
- <select id="selectByUid" resultMap="BaseResultMap">
- select <include refid="Base_Column_List"/>
- from mora_config
- where uid = #{uid}
- </select>
- </mapper>
|