<?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 2022 . All rights reserved. -->
<!--  Mybatis数据库持久层（业务层映射文件）：dw脚本版本同步表 -->
<!--  version: 1.0  -->
<!--  author:  maven-cctp-plugin    -->
<!--  date:  2022-11-25 11:15:20  -->
<mapper namespace="net.northking.cctp.dw.db.dao.DwAtuScriptVersionDao">


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

  <resultMap id="DetailMap" type="net.northking.cctp.dw.dto.atu.DwAtuScriptVersionDetailDto">
        <!--  -->
    <id column="version_id" jdbcType="INTEGER" property="versionId"/>
            <!--  -->
    <result column="script_id" jdbcType="VARCHAR" property="scriptId"/>
            <!--  -->
    <result column="created_by" jdbcType="VARCHAR" property="createdBy"/>
        <!--  -->
    <result column="created_time" jdbcType="DATE" property="createdTime"/>
    </resultMap>

  <select id="pagingQuery" resultMap="DetailMap" parameterType="net.northking.cctp.dw.db.entity.DwAtuScriptVersion">
    select
    script_id
    ,version_id
    ,created_by
    ,created_time
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="scriptId != null">
        AND script_id = #{scriptId,jdbcType=VARCHAR}
      </if>
      <if test="versionId != null">
        AND version_id = #{versionId,jdbcType=INTEGER}
      </if>
      <if test="createdBy != null">
        AND created_by = #{createdBy,jdbcType=VARCHAR}
      </if>
      <if test="createdTime != null">
        AND created_time = #{createdTime,jdbcType=DATE}
      </if>
    </trim>
  </select>
</mapper>