123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187 |
- <?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.circle.MomentReportMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
- <id column="id" property="id" jdbcType="BIGINT" />
- <result column="uid" property="uid" jdbcType="BIGINT" />
- <result column="moment_id" property="momentId" jdbcType="BIGINT" />
- <result column="player_id" property="playerId" jdbcType="BIGINT" />
- <result column="reason" property="reason" jdbcType="VARCHAR" />
- <result column="create_date" property="createDate" jdbcType="TIMESTAMP" />
- <result column="update_date" property="updateDate" jdbcType="TIMESTAMP" />
- <result column="status" property="status" jdbcType="TINYINT" />
- <result column="type" property="type" jdbcType="TINYINT" />
- </resultMap>
- <sql id="Base_Column_List" >
- id, uid, moment_id, player_id, reason, create_date, update_date, status, type
- </sql>
- <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Long" >
- select
- <include refid="Base_Column_List" />
- from moment_report
- where id = #{id,jdbcType=BIGINT}
- </select>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moment_report (uid, moment_id, player_id,
- reason, create_date, update_date,
- status, type)
- values (#{uid,jdbcType=BIGINT}, #{momentId,jdbcType=BIGINT}, #{playerId,jdbcType=BIGINT},
- #{reason,jdbcType=VARCHAR}, #{createDate,jdbcType=TIMESTAMP}, #{updateDate,jdbcType=TIMESTAMP},
- #{status,jdbcType=TINYINT}, #{type,jdbcType=TINYINT})
- </insert>
- <insert id="insertSelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" useGeneratedKeys="true" keyColumn="id" keyProperty="id">
- <selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER" >
- SELECT LAST_INSERT_ID()
- </selectKey>
- insert into moment_report
- <trim prefix="(" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- uid,
- </if>
- <if test="momentId != null" >
- moment_id,
- </if>
- <if test="playerId != null" >
- player_id,
- </if>
- <if test="reason != null" >
- reason,
- </if>
- <if test="createDate != null" >
- create_date,
- </if>
- <if test="updateDate != null" >
- update_date,
- </if>
- <if test="status != null" >
- status,
- </if>
- <if test="type != null" >
- type,
- </if>
- <if test="adminId != null" >
- admin_id,
- </if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides="," >
- <if test="uid != null" >
- #{uid,jdbcType=BIGINT},
- </if>
- <if test="momentId != null" >
- #{momentId,jdbcType=BIGINT},
- </if>
- <if test="playerId != null" >
- #{playerId,jdbcType=BIGINT},
- </if>
- <if test="reason != null" >
- #{reason,jdbcType=VARCHAR},
- </if>
- <if test="createDate != null" >
- #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateDate != null" >
- #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null" >
- #{status,jdbcType=TINYINT},
- </if>
- <if test="type != null" >
- #{type,jdbcType=TINYINT},
- </if>
- <if test="adminId != null" >
- #{adminId},
- </if>
- </trim>
- </insert>
- <update id="updateByPrimaryKeySelective" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
- update moment_report
- <set >
- <if test="uid != null" >
- uid = #{uid,jdbcType=BIGINT},
- </if>
- <if test="momentId != null" >
- moment_id = #{momentId,jdbcType=BIGINT},
- </if>
- <if test="playerId != null" >
- player_id = #{playerId,jdbcType=BIGINT},
- </if>
- <if test="reason != null" >
- reason = #{reason,jdbcType=VARCHAR},
- </if>
- <if test="createDate != null" >
- create_date = #{createDate,jdbcType=TIMESTAMP},
- </if>
- <if test="updateDate != null" >
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- </if>
- <if test="status != null" >
- status = #{status,jdbcType=TINYINT},
- </if>
- <if test="type != null" >
- type = #{type,jdbcType=TINYINT},
- </if>
- <if test="adminId != null" >
- admin_id = #{adminId},
- </if>
- </set>
- where id = #{id,jdbcType=BIGINT}
- </update>
- <update id="updateByPrimaryKey" parameterType="com.juxiao.xchat.module.xbd.domain.circle.MomentReport" >
- update moment_report
- set uid = #{uid,jdbcType=BIGINT},
- moment_id = #{momentId,jdbcType=BIGINT},
- player_id = #{playerId,jdbcType=BIGINT},
- reason = #{reason,jdbcType=VARCHAR},
- create_date = #{createDate,jdbcType=TIMESTAMP},
- update_date = #{updateDate,jdbcType=TIMESTAMP},
- status = #{status,jdbcType=TINYINT},
- type = #{type,jdbcType=TINYINT}
- where id = #{id,jdbcType=BIGINT}
- </update>
- <delete id="deleteByPrimaryKey" parameterType="java.lang.Long" >
- delete from moment_report
- where id = #{id,jdbcType=BIGINT}
- </delete>
- <select id="selectByPage" resultType="com.juxiao.xchat.module.xbd.vo.MomentReportVO">
- select mr.id,mr.uid,mr.player_id as playerId,mr.moment_id as momentId,mr.type,mr.reason,mr.create_date as createDate,
- mr.update_date as updateDate,mr.status,u.erban_no as erBanNo,u.nick,su.user_name as adminName
- from moment_report mr
- left join users u on u.uid = mr.uid
- left join sys_user su on mr.admin_id = su.user_id
- where 1 = 1
- <if test="erBanNo != null">
- and u.erban_no = #{erBanNo}
- </if>
- <if test="type != null">
- and mr.type = #{type}
- </if>
- <if test="status != null">
- and mr.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 mr.create_date between #{beginTime} and #{endTime}
- </if>
- order by mr.status asc,mr.create_date desc
- </select>
- </mapper>
|