123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160 |
- <?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.PrivatePhotoMapper" >
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.PrivatePhoto" >
- <id column="pid" property="pid" jdbcType="BIGINT" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="photo_url" property="photoUrl" jdbcType="VARCHAR" />
- <result column="seq_no" property="seqNo" jdbcType="INTEGER" />
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
- <result column="photo_status" property="photoStatus" jdbcType="TINYINT" />
- <result column="admin_id" property="adminId" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- pid, uid, photo_url, seq_no, create_time, photo_status, admin_id
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from private_photo
- where pid = #{pid,jdbcType=BIGINT}
- </select>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from private_photo
- where pid = #{pid,jdbcType=BIGINT}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrivatePhoto" >
- insert into private_photo (pid, uid, photo_url,
- seq_no, create_time, photo_status,
- admin_id,update_time)
- values (#{pid,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, #{photoUrl,jdbcType=VARCHAR},
- #{seqNo,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, #{photoStatus,jdbcType=TINYINT},
- #{adminId,jdbcType=INTEGER},#{updateTime,jdbcType=TIMESTAMP})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrivatePhoto" >
- insert into private_photo
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="pid != null" >
- pid,
- </if>
- <if test="uid != null" >
- uid,
- </if>
- <if test="photoUrl != null" >
- photo_url,
- </if>
- <if test="seqNo != null" >
- seq_no,
- </if>
- <if test="createTime != null" >
- create_time,
- </if>
- <if test="photoStatus != null" >
- photo_status,
- </if>
- <if test="adminId != null" >
- admin_id,
- </if>
- <if test="updateTime != null">
- update_time,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="pid != null" >
- #{pid,jdbcType=BIGINT},
- </if>
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="photoUrl != null" >
- #{photoUrl,jdbcType=VARCHAR},
- </if>
- <if test="seqNo != null" >
- #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="photoStatus != null" >
- #{photoStatus,jdbcType=TINYINT},
- </if>
- <if test="adminId != null" >
- #{adminId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- #{updateTime,jdbcType=TIMESTAMP},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrivatePhoto" >
- update private_photo
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="photoUrl != null" >
- photo_url = #{photoUrl,jdbcType=VARCHAR},
- </if>
- <if test="seqNo != null" >
- seq_no = #{seqNo,jdbcType=INTEGER},
- </if>
- <if test="createTime != null" >
- create_time = #{createTime,jdbcType=TIMESTAMP},
- </if>
- <if test="photoStatus != null" >
- photo_status = #{photoStatus,jdbcType=TINYINT},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- <if test="updateTime != null" >
- update_time = #{updateTime,jdbcType=INTEGER},
- </if>
- </set>
- where pid = #{pid,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.PrivatePhoto" >
- update private_photo
- set uid = #{uid,jdbcType=BIGINT},
- photo_url = #{photoUrl,jdbcType=VARCHAR},
- seq_no = #{seqNo,jdbcType=INTEGER},
- create_time = #{createTime,jdbcType=TIMESTAMP},
- photo_status = #{photoStatus,jdbcType=TINYINT},
- admin_id = #{adminId,jdbcType=INTEGER},
- private_photo = #{updateTime,jdbcType=TIMESTAMP}
- where pid = #{pid,jdbcType=BIGINT}
- </update>
- <select id="selectPrivatePhotoByList" resultType="com.juxiao.xchat.module.xbd.vo.UsersPhotoVO">
- SELECT u.uid, u.erban_no as erBanNo, u.nick, ua.photo_url as photoUrl, ua.photo_status as photoStatus, ua.create_time as createTime, ua.pid,ua.admin_id as adminId,ua.update_time as updateTime
- from users u
- INNER JOIN private_photo 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.photo_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.create_time between #{beginTime} and #{endTime}
- </if>
- </where>
- ORDER BY ua.create_time desc
- </select>
- <select id="selectPrivatePhotoByUid" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from private_photo
- where uid = #{uid}
- </select>
- </mapper>
|