| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- <?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.TrsNameResultsMapper">
-
- <resultMap type="TrsNameResults" id="TrsNameResultsResult">
- <result property="id" column="id" />
- <result property="sitename" column="sitename" />
- <result property="sitetag" column="sitetag" />
- <result property="page" column="page" />
- <result property="wrongWord" column="wrong_word" />
- <result property="country" column="country" />
- <result property="dutyAll" column="duty_all" />
- <result property="dutyShort" column="duty_short" />
- <result property="sort" column="sort" />
- <result property="context" column="context" />
- <result property="time" column="time" />
- <result property="scantime" column="scantime" />
- <result property="status" column="status" />
- <result property="version" column="version" />
- <result property="datakey" column="datakey" />
- <result property="allcontext" column="allcontext" />
- </resultMap>
- <sql id="selectTrsNameResultsVo">
- select id, sitename,sitetag, page, wrong_word, country, duty_all, duty_short, sort, context, time,scantime, status,allcontext from trs_name_results
- </sql>
- <select id="selectId" parameterType="String" resultType="Long">
- select id from trs_name_results where datakey = #{datakey}
- </select>
- <select id="selectTrsNameResultsList" parameterType="TrsNameResults" resultMap="TrsNameResultsResult">
- <include refid="selectTrsNameResultsVo"/>
- <where>
- <if test="sitename != null and sitename != ''"> and sitename = #{sitename}</if>
- <if test="sitetag != null and sitetag != ''"> and sitetag = #{sitetag}</if>
- <if test="page != null and page != ''"> and page like concat('%', #{page}, '%')</if>
- <if test="wrongWord != null and wrongWord != ''"> and wrong_word like concat('%', #{wrongWord}, '%')</if>
- <if test="country != null and country != ''"> and country like concat('%', #{country}, '%')</if>
- <if test="dutyAll != null and dutyAll != ''"> and duty_all like concat('%', #{dutyAll}, '%')</if>
- <if test="dutyShort != null and dutyShort != ''"> and duty_short like concat('%', #{dutyShort}, '%')</if>
- <if test="sort != null and sort != ''"> and sort = #{sort}</if>
- <if test="context != null and context != ''"> and context like concat('%', #{context}, '%')</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>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="version != null and version != ''"> and version = #{version}</if>
- <if test="datakey != null and datakey != ''"> and datakey = #{datakey}</if>
- </where>
- order by time desc
- </select>
-
- <select id="selectTrsNameResultsById" parameterType="Long" resultMap="TrsNameResultsResult">
- <include refid="selectTrsNameResultsVo"/>
- where id = #{id}
- </select>
- <insert id="insertTrsNameResults" parameterType="TrsNameResults" useGeneratedKeys="true" keyProperty="id">
- insert into trs_name_results
- <trim prefix="(" suffix=")" suffixOverrides=",">
- <if test="sitename != null">sitename,</if>
- <if test="sitetag != null">sitetag,</if>
- <if test="page != null">page,</if>
- <if test="wrongWord != null">wrong_word,</if>
- <if test="country != null">country,</if>
- <if test="dutyAll != null">duty_all,</if>
- <if test="dutyShort != null">duty_short,</if>
- <if test="sort != null">sort,</if>
- <if test="context != null">context,</if>
- <if test="time != null">time,</if>
- <if test="scantime != null">scantime,</if>
- <if test="status != null">status,</if>
- <if test="version != null">version,</if>
- <if test="datakey != null">datakey,</if>
- <if test="allcontext != null">allcontext,</if>
- </trim>
- <trim prefix="values (" suffix=")" suffixOverrides=",">
- <if test="sitename != null">#{sitename},</if>
- <if test="sitetag != null">#{sitetag},</if>
- <if test="page != null">#{page},</if>
- <if test="wrongWord != null">#{wrongWord},</if>
- <if test="country != null">#{country},</if>
- <if test="dutyAll != null">#{dutyAll},</if>
- <if test="dutyShort != null">#{dutyShort},</if>
- <if test="sort != null">#{sort},</if>
- <if test="context != null">#{context},</if>
- <if test="time != null">#{time},</if>
- <if test="scantime != null">#{scantime},</if>
- <if test="status != null">#{status},</if>
- <if test="version != null">#{version},</if>
- <if test="datakey != null">#{datakey},</if>
- <if test="allcontext != null">#{allcontext},</if>
- </trim>
- </insert>
- <update id="updateTrsNameResults" parameterType="TrsNameResults">
- update trs_name_results
- <trim prefix="SET" suffixOverrides=",">
- <if test="sitename != null">sitename = #{sitename},</if>
- <if test="sitetag != null">sitetag = #{sitetag},</if>
- <if test="page != null">page = #{page},</if>
- <if test="wrongWord != null">wrong_word = #{wrongWord},</if>
- <if test="country != null">country = #{country},</if>
- <if test="dutyAll != null">duty_all = #{dutyAll},</if>
- <if test="dutyShort != null">duty_short = #{dutyShort},</if>
- <if test="sort != null">sort = #{sort},</if>
- <if test="context != null">context = #{context},</if>
- <if test="time != null">time = #{time},</if>
- <if test="scantime != null">scantime = #{scantime},</if>
- <if test="status != null">status = #{status},</if>
- <if test="version != null">version = #{version},</if>
- <if test="datakey != null">datakey = #{datakey},</if>
- <if test="allcontext != null">allcontext = #{allcontext},</if>
- </trim>
- where id = #{id}
- </update>
- <delete id="deleteTrsNameResultsById" parameterType="Long">
- delete from trs_name_results where id = #{id}
- </delete>
- <delete id="deleteTrsNameResultsByIds" parameterType="String">
- delete from trs_name_results where id in
- <foreach item="id" collection="array" open="(" separator="," close=")">
- #{id}
- </foreach>
- </delete>
- <select id="getStatistics" parameterType="TrsNameResults" resultType="java.util.Map">
- SELECT
- /* 第一组:总体统计 */
- COUNT(DISTINCT datakey) AS errorWordCount,
- SUM(CASE WHEN status = '已处理' THEN 1 ELSE 0 END) AS processedCount,
- SUM(CASE WHEN status = '不必处理' THEN 1 ELSE 0 END) AS noNeedProcessCount,
- /* 第二组:严重性错误(errorGrade=1) */
- 0 AS errorWordCount2,
- 0 AS processedCount2,
- 0 AS noNeedProcessCount2,
- /* 第三组:一般性错误(errorGrade=2) */
- 0 AS errorWordCount3,
- 0 AS processedCount3,
- 0 AS noNeedProcessCount3
- FROM trs_name_results
- <where>
- <if test="sitename != null and sitename != ''"> and sitename = #{sitename}</if>
- <if test="sitetag != null and sitetag != ''"> and sitetag = #{sitetag}</if>
- <if test="page != null and page != ''"> and page = #{page}</if>
- <if test="wrongWord != null and wrongWord != ''"> and wrong_word = #{wrongWord}</if>
- <if test="country != null and country != ''"> and country = #{country}</if>
- <if test="dutyAll != null and dutyAll != ''"> and duty_all = #{dutyAll}</if>
- <if test="dutyShort != null and dutyShort != ''"> and duty_short = #{dutyShort}</if>
- <if test="sort != null and sort != ''"> and sort = #{sort}</if>
- <if test="context != null and context != ''"> and context like concat('%', #{context}, '%')</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>
- <if test="status != null and status != ''"> and status = #{status}</if>
- <if test="version != null and version != ''"> and version = #{version}</if>
- <if test="datakey != null and datakey != ''"> and datakey = #{datakey}</if>
- </where>
- </select>
- </mapper>
|