ExtractRecordMapper.xml 3.36 KB
<?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.bs.reception.mapper.ExtractRecordMapper">

    <resultMap type="com.bs.reception.entity.script.ExtractRecord" id="ExtractRecordResult">
        <id property="id" column="id" jdbcType="INTEGER"/>
        <result property="scene" column="scene" jdbcType="INTEGER"/>
        <result property="sourceId" column="source_id" jdbcType="INTEGER"/>
        <result property="classCode" column="class_code" jdbcType="VARCHAR"/>
        <result property="excellentFlag" column="excellent_flag" jdbcType="INTEGER"/>
        <result property="labelCode" column="label_code" jdbcType="VARCHAR"/>
        <result property="sceneLabelCode" column="scene_label_code" jdbcType="VARCHAR"/>
        <result property="scriptTime" column="script_time" jdbcType="TIMESTAMP"/>
        <result property="checkPushStatus" column="check_push_status" jdbcType="INTEGER"/>
        <result property="checkStatus" column="check_status" jdbcType="INTEGER"/>
        <result property="inputTime" column="input_time" jdbcType="TIMESTAMP"/>
        <result property="pushStatus" column="push_status" jdbcType="INTEGER"/>
        <result property="pushTime" column="push_time" jdbcType="TIMESTAMP"/>
        <result property="timeStamp" column="time_stamp" jdbcType="VARCHAR"/>
        <result property="sourceContent" column="source_content" jdbcType="LONGVARCHAR"/>
        <result property="polishContent" column="polish_content" jdbcType="LONGVARCHAR"/>
        <result property="subLabel" column="sub_label" jdbcType="VARCHAR"/>
        <result property="createdBy" column="created_by" jdbcType="VARCHAR"/>
        <result property="createdTime" column="created_time" jdbcType="TIMESTAMP"/>
        <result property="updatedBy" column="updated_by" jdbcType="VARCHAR"/>
        <result property="updatedTime" column="updated_time" jdbcType="TIMESTAMP"/>
        <result property="delFlag" column="del_flag" jdbcType="CHAR"/>
    </resultMap>

    <sql id="selectExtractRecordVo">
        select id,
               scene,
               source_id,
               class_code,
               excellent_flag,
               label_code,
               scene_label_code,
               script_time,
               check_push_status,
               check_status,
               input_time,
               push_status,
               push_time,
               time_stamp,
               source_content,
               polish_content,
               sub_label,
               created_by,
               created_time,
               updated_by,
               updated_time,
               del_flag
        from script_extract_record
    </sql>
    <select id="getSuggestionLabel" resultType="com.bs.reception.model.script.LabelInfoResponse">
        <foreach collection="labelRequest.tagList" item="item" separator="union all">
            (select t1.scene_label_name as labelName, t2.polish_content as suggestion, t2.id as labelId
            from script_extract_config_scene_label t1
            inner join script_extract_record t2 on t1.scene_label_code = t2.scene_label_code and t2.del_flag = 'N'
            where t1.del_flag = 'N' and t1.scene_label_name = #{item}
            order by t2.created_time desc
            limit #{labelRequest.tagResponseCount})
        </foreach>
    </select>

</mapper>