123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <?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.UsersAvatarMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UsersAvatar" >
- <id column="uid" property="uid" jdbcType="BIGINT" />
- <result column="avatar" property="avatar" jdbcType="VARCHAR" />
- <result column="avatar_status" property="avatarStatus" jdbcType="TINYINT" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="update_time" property="updateTime" jdbcType="TIMESTAMP" />
- <result column="admin_id" property="adminId" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- uid, avatar, avatar_status, create_time, update_time, admin_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from users_avatar
- where uid = #{uid,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from users_avatar
- where uid = #{uid,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersAvatar" >
- insert into users_avatar (uid, avatar, avatar_status,
- create_time, update_time, admin_id
- )
- values (#{uid,jdbcType=BIGINT}, #{avatar,jdbcType=VARCHAR}, #{avatarStatus,jdbcType=TINYINT},
- #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP}, #{adminId,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersAvatar" >
- insert into users_avatar
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="avatar != null" >
- avatar,
- </if>
- <if test="avatarStatus != null" >
- avatar_status,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="updateTime != null" >
- update_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="avatar != null" >
- #{avatar,jdbcType=VARCHAR},
- </if>
- <if test="avatarStatus != null" >
- #{avatarStatus,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- #{adminId,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersAvatar" >
- update users_avatar
- <set >
- <if test="avatar != null" >
- avatar = #{avatar,jdbcType=VARCHAR},
- </if>
- <if test="avatarStatus != null" >
- avatar_status = #{avatarStatus,jdbcType=TINYINT},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="updateTime != null" >
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- </set>
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UsersAvatar" >
- update users_avatar
- set avatar = #{avatar,jdbcType=VARCHAR},
- avatar_status = #{avatarStatus,jdbcType=TINYINT},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- update_time = #{updateTime,jdbcType=TIMESTAMP},
- admin_id = #{adminId,jdbcType=INTEGER}
- where uid = #{uid,jdbcType=BIGINT}
- </update>
- <select id="selectUsersAvatarByList" resultType="com.juxiao.xchat.module.xbd.vo.UsersAvatarVO">
- SELECT u.uid, u.erban_no as erBanNo, u.nick, u.avatar, ua.avatar as newAvatar, ua.avatar_status as avatarStatus, ua.create_time as createTime, ua.update_time as updateTime,ua.admin_id as adminId
- from users u
- INNER JOIN users_avatar ua on u.uid = ua.uid
- left join sys_user su on ua.admin_id = su.user_id
- <where>
- <if test="erBanNo != null">
- AND u.erban_no = #{erBanNo}
- </if>
- <if test="status != null">
- AND ua.avatar_status = #{status}
- </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 ua.update_time between #{beginTime} and #{endTime}
- </if>
- </where>
- ORDER BY ua.create_time desc , ua.update_time desc
- </select>
- </mapper>
|