12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <?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.operation.SensitiveWordMapper">
- <resultMap id="BaseResultMap" type="com.juxiao.xchat.module.xbd.domain.operation.SensitiveWord">
- <id column="id" property="id" jdbcType="INTEGER"/>
- <result column="sensitive_words" property="sensitiveWords" jdbcType="VARCHAR"/>
- <result column="admin_id" property="adminId" jdbcType="INTEGER"/>
- <result column="create_time" property="createTime" jdbcType="TIMESTAMP"/>
- <result column="type" property="type" jdbcType="TINYINT"/>
- <result column="adminName" property="adminName" jdbcType="VARCHAR"/>
- </resultMap>
- <select id="listSensitiveWord" resultMap="BaseResultMap">
- select r.id, r.sensitive_words, r.admin_id, r.create_time, r.type,IFNULL(u.user_name,'未知') as adminName
- from room_sensitive_words r
- left join sys_user u on r.admin_id=u.user_id
- where 1 = 1
- <if test="searchText!=null and searchText!=''">
- AND r.sensitive_words like concat('%',#{searchText},'%')
- </if>
- <if test="type!=null and type!=''">
- AND r.type = #{type}
- </if>
- ORDER BY r.create_time desc
- </select>
- <delete id="deleteById" parameterType="java.lang.Integer">
- delete from room_sensitive_words
- where id = #{id,jdbcType=INTEGER}
- </delete>
- <insert id="insert" parameterType="com.juxiao.xchat.module.xbd.domain.operation.SensitiveWord">
- REPLACE into room_sensitive_words ( sensitive_words, admin_id,
- create_time, type)
- values ( #{sensitiveWords,jdbcType=VARCHAR}, #{adminId,jdbcType=INTEGER},
- #{createTime,jdbcType=TIMESTAMP}, #{type,jdbcType=TINYINT})
- </insert>
- <insert id="batchInsert">
- REPLACE INTO room_sensitive_words ( sensitive_words, admin_id,
- create_time, type) values
- <foreach item='item' index='index' collection='sensitiveWordList' separator=','>
- (#{item.sensitiveWords,jdbcType=VARCHAR}, #{item.adminId,jdbcType=INTEGER},
- #{item.createTime,jdbcType=TIMESTAMP}, #{item.type,jdbcType=TINYINT})
- </foreach>
- </insert>
- </mapper>
|