<?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">
<!--  Copyright (c) 京北方信息技术股份有限公司 Corporation 2023 . All rights reserved. -->
<!--  Mybatis数据库持久层（业务层映射文件）：脚本输入项关联草稿表版本表 -->
<!--  version: 1.0  -->
<!--  author:  maven-cctp-plugin    -->
<!--  date:  2023-09-04 17:42:26  -->
<mapper namespace="net.northking.cctp.scriptcase.db.dao.AtuScriptInputSetVersionDao">


  <!-- 请在本文件内添加自定义SQL语句 -->

  <resultMap id="DetailMap" type="net.northking.cctp.scriptcase.dto.atuscriptrecord.AtuScriptInputSetVersionDetailDto">
      <!-- 主键 -->
    <id column="id" jdbcType="VARCHAR" property="id"/>
                        <!-- 脚本版本表主键 -->
    <result column="script_version_id" jdbcType="INTEGER" property="scriptVersionId"/>
        <!-- 脚本id -->
    <result column="script_id" jdbcType="VARCHAR" property="scriptId"/>
        <!-- 环境id -->
    <result column="env_id" jdbcType="VARCHAR" property="envId"/>
        <!-- 输入项数据文件地址 -->
    <result column="data_url" jdbcType="VARCHAR" property="dataUrl"/>
        <!-- 创建时间 -->
    <result column="created_time" jdbcType="TIMESTAMP" property="createdTime"/>
        <!-- 创建人 -->
    <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
    </resultMap>

  <select id="pagingQuery" resultMap="DetailMap" parameterType="net.northking.cctp.scriptcase.db.entity.AtuScriptInputSetVersion">
    select
    id
    ,script_version_id
    ,script_id
    ,env_id
    ,data_url
    ,created_time
    ,created_by
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="id != null">
        AND id = #{id,jdbcType=VARCHAR}
      </if>
      <if test="scriptVersionId != null">
        AND script_version_id = #{scriptVersionId,jdbcType=INTEGER}
      </if>
      <if test="scriptId != null">
        AND script_id = #{scriptId,jdbcType=VARCHAR}
      </if>
      <if test="envId != null">
        AND env_id = #{envId,jdbcType=VARCHAR}
      </if>
      <if test="dataUrl != null">
        AND data_url = #{dataUrl,jdbcType=VARCHAR}
      </if>
      <if test="createdTime != null">
        AND created_time = #{createdTime,jdbcType=TIMESTAMP}
      </if>
      <if test="createdBy != null">
        AND created_by = #{createdBy,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>
</mapper>