<?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 2021 . All rights reserved. -->
<!--  Mybatis数据库持久层（业务层映射文件）：跨项目级视图索引信息表 -->
<!--  version: 1.0  -->
<!--  author:  maven-cctp-plugin    -->
<!--  date:  2021-12-15 11:38:02  -->
<mapper namespace="net.northking.cctp.testbug.db.dao.OverallViewIndexDao">


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

  <resultMap id="DetailMap" type="net.northking.cctp.testbug.dto.OverallViewIndexDetailDto">
      <!--  -->
    <id column="id" jdbcType="VARCHAR" property="id"/>
                <!-- 项目id集合 -->
    <result column="pro_id_list" jdbcType="VARCHAR" property="proIdList"/>
        <!-- 用户id -->
    <result column="user_id" jdbcType="VARCHAR" property="userId"/>
        <!-- 记录类型 -->
    <result column="record_type" jdbcType="VARCHAR" property="recordType"/>
    </resultMap>


  <select id="pagingQuery" resultMap="DetailMap" parameterType="net.northking.cctp.testbug.db.entity.OverallViewIndex">
    select
    id
    ,pro_id_list
    ,user_id
    ,record_type
    from
    <include refid="Table_Name"/>
    <trim prefix="WHERE" prefixOverrides="AND" >
      <if test="id != null">
        AND id = #{id,jdbcType=VARCHAR}
      </if>
      <if test="proIdList != null">
        AND pro_id_list = #{proIdList,jdbcType=VARCHAR}
      </if>
      <if test="userId != null">
        AND user_id = #{userId,jdbcType=VARCHAR}
      </if>
      <if test="recordType != null">
        AND record_type = #{recordType,jdbcType=VARCHAR}
      </if>
    </trim>
  </select>
</mapper>