RecordingCheckResultDetailMapper.xml 1.92 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.RecordingCheckResultDetailMapper">

  <resultMap id="BaseResultMap" type="com.bs.reception.entity.bigmodel.RecordingCheckResultDetailDTO">
    <id column="id" jdbcType="INTEGER" property="id" />
    <result column="check_result_id" jdbcType="INTEGER" property="checkResultId" />
    <result column="tag_id" jdbcType="INTEGER" property="tagId" />
    <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="VARCHAR" property="deletedFlag" />
    <result column="score" jdbcType="DECIMAL" property="score" />
    <result column="hit_text" jdbcType="VARCHAR" property="hitText" />
    <result column="sum_score" jdbcType="DECIMAL" property="sumScore" />
    <result column="script_rec" jdbcType="VARCHAR" property="scriptRec" />
    <result column="tagName" jdbcType="VARCHAR" property="tagName" />
    <result column="tagGroupName" jdbcType="VARCHAR" property="tagGroupName" />
  </resultMap>
  <select id="findCheckResultByCheckResultId"
          resultMap="BaseResultMap">

    SELECT  t1.id,
    t1.check_result_id,
    t1.tag_id,
    t1.created_by,
    t1.created_date,
    t1.updated_by,
    t1.updated_date,
    t1.deleted_flag,
    t1.score,
    t1.hit_text,
    t1.sum_score,
    t1.script_rec,t2.value_name as tagName,t3.group_name as tagGroupName FROM recording_check_result_detail t1
    left join recording_tag_value t2 on t1.tag_id =t2.id
    left join recording_tag_group t3 on t2.tag_groupid =t3.id
    where t1.check_result_id=#{checkResultId}
  </select>
</mapper>