123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208 |
- <?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.UserAvatarReportRecordMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserAvatarReportRecord" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="report_uid" property="reportUid" jdbcType="BIGINT" />
- <result column="device_id" property="deviceId" jdbcType="VARCHAR" />
- <result column="url" property="url" jdbcType="VARCHAR" />
- <result column="phone_no" property="phoneNo" jdbcType="VARCHAR" />
- <result column="ip" property="ip" jdbcType="VARCHAR" />
- <result column="report_type" property="reportType" jdbcType="CHAR" />
- <result column="type" property="type" jdbcType="CHAR" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="INTEGER" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, report_uid, device_id, url, phone_no, ip, report_type, type, create_date,
- status
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from user_avatar_report_record
- where id = #{id,jdbcType=BIGINT}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserAvatarReportRecord" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_avatar_report_record (uid, report_uid, device_id,
- url, phone_no, ip, report_type,
- type, create_date, status
- )
- values (#{uid,jdbcType=BIGINT}, #{reportUid,jdbcType=BIGINT}, #{deviceId,jdbcType=VARCHAR},
- #{url,jdbcType=VARCHAR}, #{phoneNo,jdbcType=VARCHAR}, #{ip,jdbcType=VARCHAR}, #{reportType,jdbcType=CHAR},
- #{type,jdbcType=CHAR}, #{createDate,jdbcType=TIMESTAMP}, #{status,jdbcType=INTEGER}
- )
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserAvatarReportRecord" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_avatar_report_record
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="reportUid != null" >
- report_uid,
- </if>
- <if test="deviceId != null" >
- device_id,
- </if>
- <if test="url != null" >
- url,
- </if>
- <if test="phoneNo != null" >
- phone_no,
- </if>
- <if test="ip != null" >
- ip,
- </if>
- <if test="reportType != null" >
- report_type,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="createDate != null" >
- create_date,
- </if>
- <if test="status != null" >
- status,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="reportUid != null" >
- #{reportUid,jdbcType=BIGINT},
- </if>
- <if test="deviceId != null" >
- #{deviceId,jdbcType=VARCHAR},
- </if>
- <if test="url != null" >
- #{url,jdbcType=VARCHAR},
- </if>
- <if test="phoneNo != null" >
- #{phoneNo,jdbcType=VARCHAR},
- </if>
- <if test="ip != null" >
- #{ip,jdbcType=VARCHAR},
- </if>
- <if test="reportType != null" >
- #{reportType,jdbcType=CHAR},
- </if>
- <if test="type != null" >
- #{type,jdbcType=CHAR},
- </if>
- <if test="createDate != null" >
- #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null" >
- #{status,jdbcType=INTEGER},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserAvatarReportRecord" >
- update user_avatar_report_record
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="reportUid != null" >
- report_uid = #{reportUid,jdbcType=BIGINT},
- </if>
- <if test="deviceId != null" >
- device_id = #{deviceId,jdbcType=VARCHAR},
- </if>
- <if test="url != null" >
- url = #{url,jdbcType=VARCHAR},
- </if>
- <if test="phoneNo != null" >
- phone_no = #{phoneNo,jdbcType=VARCHAR},
- </if>
- <if test="ip != null" >
- ip = #{ip,jdbcType=VARCHAR},
- </if>
- <if test="reportType != null" >
- report_type = #{reportType,jdbcType=CHAR},
- </if>
- <if test="type != null" >
- type = #{type,jdbcType=CHAR},
- </if>
- <if test="createDate != null" >
- create_date = #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=INTEGER},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId,jdbcType=INTEGER},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserAvatarReportRecord" >
- update user_avatar_report_record
- set uid = #{uid,jdbcType=BIGINT},
- report_uid = #{reportUid,jdbcType=BIGINT},
- device_id = #{deviceId,jdbcType=VARCHAR},
- url = #{url,jdbcType=VARCHAR},
- phone_no = #{phoneNo,jdbcType=VARCHAR},
- ip = #{ip,jdbcType=VARCHAR},
- report_type = #{reportType,jdbcType=CHAR},
- type = #{type,jdbcType=CHAR},
- create_date = #{createDate,jdbcType=TIMESTAMP},
- status = #{status,jdbcType=INTEGER}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from user_avatar_report_record
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <select id="selectUserAvatarReportRecordByPage" resultType="com.juxiao.xchat.module.xbd.vo.UserAvatarReportRecordVO">
- select uarr.id, uarr.uid, uarr.report_uid as reportUid, uarr.device_id as deviceId, uarr.url, uarr.ip, uarr.report_type as reportType, uarr.type, uarr.create_date as createDate,uarr.status,su.user_name as adminName,
- u.erban_no as erBanNo,u.nick ,ru.erban_no as reportErBanNo,ru.nick as reportNick
- from user_avatar_report_record uarr
- left join sys_user su on su.user_id = uarr.admin_id
- left join users u on u.uid = uarr.uid
- left join users ru on ru.uid = uarr.report_uid
- where 1 = 1
- <if test="erBanNo != null">
- and u.erban_no = #{erBanNo}
- </if>
- <if test="reportErBanNo != null">
- and ru.erban_no = #{reportErBanNo}
- </if>
- <if test="erBanNo != null and reportErBanNo != null">
- and u.erban_no = #{erBanNo} or ru.erban_no = #{reportErBanNo}
- </if>
- <if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
- and uarr.create_date between #{beginTime} and #{endTime}
- </if>
- <if test="reportType != null">
- and uarr.report_type = #{reportType}
- </if>
- <if test="adminName != null and adminName != ''">
- and su.user_name = #{adminName}
- </if>
- order by create_date desc
- </select>
- </mapper>
|