123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266 |
- <?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.AccountBannedMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="uid" jdbcType="BIGINT" property="uid" />
- <result column="erban_no" jdbcType="BIGINT" property="erbanNo" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
- <result column="banned_type" jdbcType="VARCHAR" property="bannedType" />
- <result column="banned_ip" jdbcType="VARCHAR" property="bannedIp" />
- <result column="banned_status" jdbcType="TINYINT" property="bannedStatus" />
- <result column="banned_minute" jdbcType="INTEGER" property="bannedMinute" />
- <result column="banned_start_time" jdbcType="TIMESTAMP" property="bannedStartTime" />
- <result column="banned_end_time" jdbcType="TIMESTAMP" property="bannedEndTime" />
- <result column="banned_desc" jdbcType="VARCHAR" property="bannedDesc" />
- <result column="admin_id" jdbcType="INTEGER" property="adminId" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- </resultMap>
- <resultMap id="BaseVOResultMap" type="com.juxiao.xchat.module.xbd.vo.AccountBannedVO">
- <id column="id" jdbcType="INTEGER" property="id" />
- <result column="uid" jdbcType="BIGINT" property="uid" />
- <result column="erban_no" jdbcType="BIGINT" property="erbanNo" />
- <result column="phone" jdbcType="VARCHAR" property="phone" />
- <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
- <result column="banned_type" jdbcType="VARCHAR" property="bannedType" />
- <result column="banned_ip" jdbcType="VARCHAR" property="bannedIp" />
- <result column="banned_status" jdbcType="TINYINT" property="bannedStatus" />
- <result column="banned_minute" jdbcType="INTEGER" property="bannedMinute" />
- <result column="banned_start_time" jdbcType="TIMESTAMP" property="bannedStartTime" />
- <result column="banned_end_time" jdbcType="TIMESTAMP" property="bannedEndTime" />
- <result column="banned_desc" jdbcType="VARCHAR" property="bannedDesc" />
- <result column="admin_id" jdbcType="INTEGER" property="adminId" />
- <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
- <result column="user_name" jdbcType="VARCHAR" property="adminName" />
- <result column="block_time" jdbcType="VARCHAR" property="blockTime"/>
- </resultMap>
- <sql id="Base_Column_List">
- id, uid, erban_no, phone, device_id, banned_type, banned_ip, banned_status, banned_minute,
- banned_start_time, banned_end_time, banned_desc, admin_id, create_time
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Integer" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from account_banned
- where id = #{id,jdbcType=INTEGER}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer">
- delete from account_banned
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into account_banned (uid, erban_no, phone,
- device_id, banned_type, banned_ip,
- banned_status, banned_minute, banned_start_time,
- banned_end_time, banned_desc, admin_id,
- create_time,block_time)
- values (#{uid,jdbcType=BIGINT}, #{erbanNo,jdbcType=BIGINT}, #{phone,jdbcType=VARCHAR},
- #{deviceId,jdbcType=VARCHAR}, #{bannedType,jdbcType=VARCHAR}, #{bannedIp,jdbcType=VARCHAR},
- #{bannedStatus,jdbcType=TINYINT}, #{bannedMinute,jdbcType=INTEGER}, #{bannedStartTime,jdbcType=TIMESTAMP},
- #{bannedEndTime,jdbcType=TIMESTAMP}, #{bannedDesc,jdbcType=VARCHAR}, #{adminId,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP},#{blockTime,jdbcType=VARCHAR})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Integer">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into account_banned
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="uid != null">
- uid,
- </if>
- <if test="erbanNo != null">
- erban_no,
- </if>
- <if test="phone != null">
- phone,
- </if>
- <if test="deviceId != null">
- device_id,
- </if>
- <if test="bannedType != null">
- banned_type,
- </if>
- <if test="bannedIp != null">
- banned_ip,
- </if>
- <if test="bannedStatus != null">
- banned_status,
- </if>
- <if test="bannedMinute != null">
- banned_minute,
- </if>
- <if test="bannedStartTime != null">
- banned_start_time,
- </if>
- <if test="bannedEndTime != null">
- banned_end_time,
- </if>
- <if test="bannedDesc != null">
- banned_desc,
- </if>
- <if test="adminId != null">
- admin_id,
- </if>
- <if test="createTime != null">
- create_time,
- </if>
- <if test="blockTime != null">
- block_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="uid != null">
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="erbanNo != null">
- #{erbanNo,jdbcType=BIGINT},
- </if>
- <if test="phone != null">
- #{phone,jdbcType=VARCHAR},
- </if>
- <if test="deviceId != null">
- #{deviceId,jdbcType=VARCHAR},
- </if>
- <if test="bannedType != null">
- #{bannedType,jdbcType=VARCHAR},
- </if>
- <if test="bannedIp != null">
- #{bannedIp,jdbcType=VARCHAR},
- </if>
- <if test="bannedStatus != null">
- #{bannedStatus,jdbcType=TINYINT},
- </if>
- <if test="bannedMinute != null">
- #{bannedMinute,jdbcType=INTEGER},
- </if>
- <if test="bannedStartTime != null">
- #{bannedStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bannedEndTime != null">
- #{bannedEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bannedDesc != null">
- #{bannedDesc,jdbcType=VARCHAR},
- </if>
- <if test="adminId != null">
- #{adminId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="blockTime != null" >
- #{blockTime,jdbcType=VARCHAR},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
- update account_banned
- <set>
- <if test="uid != null">
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="erbanNo != null">
- erban_no = #{erbanNo,jdbcType=BIGINT},
- </if>
- <if test="phone != null">
- phone = #{phone,jdbcType=VARCHAR},
- </if>
- <if test="deviceId != null">
- device_id = #{deviceId,jdbcType=VARCHAR},
- </if>
- <if test="bannedType != null">
- banned_type = #{bannedType,jdbcType=VARCHAR},
- </if>
- <if test="bannedIp != null">
- banned_ip = #{bannedIp,jdbcType=VARCHAR},
- </if>
- <if test="bannedStatus != null">
- banned_status = #{bannedStatus,jdbcType=TINYINT},
- </if>
- <if test="bannedMinute != null">
- banned_minute = #{bannedMinute,jdbcType=INTEGER},
- </if>
- <if test="bannedStartTime != null">
- banned_start_time = #{bannedStartTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bannedEndTime != null">
- banned_end_time = #{bannedEndTime,jdbcType=TIMESTAMP},
- </if>
- <if test="bannedDesc != null">
- banned_desc = #{bannedDesc,jdbcType=VARCHAR},
- </if>
- <if test="adminId != null">
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- <if test="createTime != null">
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="blockTime != null" >
- block_time = #{blockTime,jdbcType=VARCHAR},
- </if>
- </set>
- where id = #{id,jdbcType=INTEGER}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.AccountBanned">
- update account_banned
- set uid = #{uid,jdbcType=BIGINT},
- erban_no = #{erbanNo,jdbcType=BIGINT},
- phone = #{phone,jdbcType=VARCHAR},
- device_id = #{deviceId,jdbcType=VARCHAR},
- banned_type = #{bannedType,jdbcType=VARCHAR},
- banned_ip = #{bannedIp,jdbcType=VARCHAR},
- banned_status = #{bannedStatus,jdbcType=TINYINT},
- banned_minute = #{bannedMinute,jdbcType=INTEGER},
- banned_start_time = #{bannedStartTime,jdbcType=TIMESTAMP},
- banned_end_time = #{bannedEndTime,jdbcType=TIMESTAMP},
- banned_desc = #{bannedDesc,jdbcType=VARCHAR},
- admin_id = #{adminId,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- block_time = #{blockType,jdbcType=VARCHAR}
- where id = #{id,jdbcType=INTEGER}
- </update>
- <select id="selectAccountBannedByList" resultMap="BaseVOResultMap">
- select ab.id, ab.uid, ab.erban_no, ab.phone, ab.device_id, ab.banned_type, ab.banned_ip,ab.banned_status,
- ab.banned_minute,ab.banned_start_time, ab.banned_end_time, ab.banned_desc, ab.admin_id, ab.create_time,
- su.user_name,ab.block_time
- from account_banned ab
- left join sys_user su on ab.admin_id = su.user_id
- where
- 1 = 1
- <if test="erbanNo != null and erbanNo != ''">
- and ab.erban_no = #{erbanNo}
- </if>
- <if test="deviceId != null and deviceId != ''">
- and ab.device_id = #{deviceId}
- </if>
- <if test="type != null">
- and ab.banned_type = #{type}
- </if>
- <if test="adminName != null and adminName != ''">
- and su.user_name = #{adminName}
- </if>
- order by ab.create_time desc
- </select>
- <select id="selectByUid" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from account_banned
- where uid = #{uid}
- </select>
- </mapper>
|