| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116 |
- <?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.ruoyi.project.mapper.TrsDomainWordsMapper">
-
- <resultMap type="TrsDomainWords" id="TrsDomainWordsResult">
- <result property="id" column="id" />
- <result property="wrongWord" column="wrong_word" />
- <result property="domainType" column="domain_type" />
- <result property="dictType" column="dict_type" />
- <result property="flag" column="flag" />
- <result property="status" column="status" />
- <result property="time" column="time" />
- <result property="effectstart" column="effectstart" />
- <result property="effectend" column="effectend" />
- <result property="deptId" column="dept_id" />
- </resultMap>
- <sql id="selectTrsDomainWordsVo">
- select t.id, t.wrong_word, t.domain_type, t.dict_type, t.flag, t.status,t.time, t.effectstart, t.effectend,t.dept_id from trs_domain_words t
- </sql>
- <select id="selectTrsWordsListByErrorWord" parameterType="String" resultMap="TrsDomainWordsResult">
- <include refid="selectTrsDomainWordsVo"/>
- where wrong_word = #{errorWord}
- order by t.time desc
- </select>
- <select id="selectTrsDomainWordsList" parameterType="TrsDomainWords" resultMap="TrsDomainWordsResult">
- <include refid="selectTrsDomainWordsVo"/>
- <if test="params.dataScope != null and params.dataScope != ''">
- <!-- 添加部门表关联 -->
- LEFT JOIN sys_dept d ON t.dept_id = d.dept_id
- </if>
- <where>
- <if test="wrongWord != null and wrongWord != ''"> and wrong_word like concat('%', #{wrongWord}, '%')</if>
- <if test="domainType != null and domainType != ''"> and domain_type = #{domainType}</if>
- <if test="status != null and status != ''"> and t.status = #{status}</if>
- <if test="params.beginTime != null and params.beginTime != '' and params.endTime != null and params.endTime != ''"> and time between #{params.beginTime} and #{params.endTime}</if>
- <choose>
- <when test="deptId != null and deptId == 100">
- <!-- 教对部门可以看到所有数据 -->
- and (t.dept_id = 100 or t.dept_id = 0)
- </when>
- <otherwise>
- <!-- 数据范围过滤移动到where标签内 -->
- <if test="params.dataScope != null and params.dataScope != ''">
- ${params.dataScope}
- </if>
- </otherwise>
- </choose>
- </where>
- order by t.time desc
- </select>
-
- <select id="selectTrsDomainWordsById" parameterType="Long" resultMap="TrsDomainWordsResult">
- <include refid="selectTrsDomainWordsVo"/>
- where id = #{id}
- </select>
- <insert id="insertTrsDomainWords" parameterType="TrsDomainWords" useGeneratedKeys="true" keyProperty="id">
- insert into trs_domain_words
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="wrongWord != null and wrongWord != ''">wrong_word,</if>
- <if test="domainType != null">domain_type,</if>
- <if test="dictType != null">dict_type,</if>
- <if test="flag != null">flag,</if>
- <if test="status != null">status,</if>
- <if test="time != null">time,</if>
- <if test="effectstart != null">effectstart,</if>
- <if test="effectend != null">effectend,</if>
- <if test="deptId != null">dept_id,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="wrongWord != null and wrongWord != ''">#{wrongWord},</if>
- <if test="domainType != null">#{domainType},</if>
- <if test="dictType != null">#{dictType},</if>
- <if test="flag != null">#{flag},</if>
- <if test="status != null">#{status},</if>
- <if test="time != null">#{time},</if>
- <if test="effectstart != null">#{effectstart},</if>
- <if test="effectend != null">#{effectend},</if>
- <if test="deptId != null">#{deptId},</if>
- </trim>
- </insert>
- <update id="updateTrsDomainWords" parameterType="TrsDomainWords">
- update trs_domain_words
- <trim prefix="SET" suffixOverrides=",">
- <if test="wrongWord != null and wrongWord != ''">wrong_word = #{wrongWord},</if>
- <if test="domainType != null">domain_type = #{domainType},</if>
- <if test="dictType != null">dict_type = #{dictType},</if>
- <if test="flag != null">flag = #{flag},</if>
- <if test="status != null">status = #{status},</if>
- <if test="time != null">time = #{time},</if>
- <if test="effectstart != null">effectstart = #{effectstart},</if>
- <if test="effectend != null">effectend = #{effectend},</if>
- <if test="deptId != null">dept_id = #{deptId},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTrsDomainWordsById" parameterType="Long">
- delete from trs_domain_words where id = #{id}
- </delete>
- <delete id="deleteTrsDomainWordsByIds" parameterType="String">
- delete from trs_domain_words where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- </mapper>
|