123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202 |
- <?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.UserReportRecordMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.users.UserReportRecord">
- <id column="id" jdbcType="BIGINT" property="id" />
- <result column="uid" jdbcType="BIGINT" property="uid" />
- <result column="report_uid" jdbcType="BIGINT" property="reportUid" />
- <result column="device_id" jdbcType="VARCHAR" property="deviceId" />
- <result column="phone_no" jdbcType="VARCHAR" property="phoneNo" />
- <result column="ip" jdbcType="VARCHAR" property="ip" />
- <result column="report_type" jdbcType="CHAR" property="reportType" />
- <result column="type" jdbcType="CHAR" property="type" />
- <result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
- <result column="status" jdbcType="INTEGER" property="status" />
- </resultMap>
- <sql id="Base_Column_List">
- id, uid, report_uid, device_id, phone_no, ip, report_type, type, create_date, status
- </sql>
- <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
- select
- <include refid="Base_Column_List" />
- from user_report_record
- where id = #{id,jdbcType=BIGINT}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.users.UserReportRecord" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_report_record (uid, report_uid, device_id,
- phone_no, ip, report_type,
- type, create_date, status
- )
- values (#{uid,jdbcType=BIGINT}, #{reportUid,jdbcType=BIGINT}, #{deviceId,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.UserReportRecord" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
- <selectKey keyProperty="id" order="AFTER" resultType="java.lang.Long">
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into user_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="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="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.UserReportRecord">
- update user_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="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.UserReportRecord">
- update user_report_record
- set uid = #{uid,jdbcType=BIGINT},
- report_uid = #{reportUid,jdbcType=BIGINT},
- device_id = #{deviceId,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_report_record
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <select id="selectUserReportRecordByPage" resultType="com.juxiao.xchat.module.xbd.vo.UserReportRecordVO">
- select uarr.id, uarr.uid, uarr.report_uid as reportUid, uarr.device_id as deviceId, uarr.type, 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_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="type != null">
- and uarr.type = #{type}
- </if>
- <if test="adminName != null and adminName != ''">
- and su.user_name = #{adminName}
- </if>
- order by create_date desc
- </select>
- </mapper>
|