ConversationCheckDetailMapper.xml 3.52 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="cn.com.glsx.dj.mindworkplate.mapper.ConversationCheckDetailMapper">
  <resultMap id="BaseResultMap" type="cn.com.glsx.dj.mindworkplate.model.ConversationCheckDetail">
    <!--
      WARNING - @mbg.generated
    -->
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="batch_id" jdbcType="INTEGER" property="batchId" />
    <result column="first_classify" jdbcType="VARCHAR" property="firstClassify" />
    <result column="second_classify" jdbcType="VARCHAR" property="secondClassify" />
    <result column="score" jdbcType="DECIMAL" property="score" />
    <result column="raw_score" jdbcType="DECIMAL" property="rawScore" />
    <result column="hit_result" jdbcType="TINYINT" property="hitResult" />
    <result column="hit_text" jdbcType="VARCHAR" property="hitText" />
    <result column="suggestions" jdbcType="VARCHAR" property="suggestions" />
    <result column="created_by" jdbcType="VARCHAR" property="createdBy" />
    <result column="created_date" jdbcType="TIMESTAMP" property="createdDate" />
    <result column="updated_by" jdbcType="VARCHAR" property="updatedBy" />
    <result column="updated_date" jdbcType="TIMESTAMP" property="updatedDate" />
    <result column="deleted_flag" jdbcType="CHAR" property="deletedFlag" />
  </resultMap>
  <resultMap extends="BaseResultMap" id="ResultMapWithBLOBs" type="cn.com.glsx.dj.mindworkplate.model.ConversationCheckDetail">
    <!--
      WARNING - @mbg.generated
    -->
    <result column="hit_text" jdbcType="LONGVARCHAR" property="hitText" />
  </resultMap>
  <sql id="Base_Column_List">
    <!--
      WARNING - @mbg.generated
    -->
    id, batch_id, first_classify, second_classify, score, raw_score, hit_result, hit_text, suggestions,
    created_by, created_date, updated_by, updated_date, deleted_flag
  </sql>

    <resultMap id="ccdDtoResult" type="cn.com.glsx.dj.mindworkplate.dto.ConversationCheckDetailDTO"
               extends="BaseResultMap">
    </resultMap>

    <select id="page" parameterType="cn.com.glsx.dj.mindworkplate.dto.ConversationCheckDetailRequestDTO" resultMap="ccdDtoResult">
        select * from inspection_conversation_check_detail ccd
        <where>
            ccd.deleted_flag = 'N'
            <if test="batchId != null">
              and ccd.batch_id = #{batchId}
            </if>
            <if test="batchIds != null and batchIds.size>0">
              and ccd.batch_id in
              <foreach close=")" collection="batchIds" item="item" open="(" separator=",">
                #{item}
              </foreach>
            </if>

            <if test="firstClassify != null and firstClassify != ''">
                and ccd.first_classify = #{firstClassify}
            </if>
            <if test="secondClassify != null and secondClassify != ''">
                and ccd.second_classify = #{secondClassify}
            </if>
            <if test="hitResult != null">
                and ccd.hit_result = #{hitResult}
            </if>
            <if test="qualityTestScoreBegin != null">
                and ccd.score &gt;= #{qualityTestScoreBegin}
            </if>
            <if test="qualityTestScoreEnd != null">
                and ccd.score &lt;= #{qualityTestScoreEnd}
            </if>
        </where>
    </select>

    <update id="deleteByBatchId">
        update inspection_conversation_check_detail set deleted_flag='D', updated_date=now() where batch_id=#{batchId}
    </update>
</mapper>