<?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.yifu.cloud.plus.v1.batch.mapper.TTaskArchiveRelationMapper">

  <resultMap id="tTaskArchiveRelationMap" type="com.yifu.cloud.plus.v1.batch.entity.TTaskArchiveRelation">
    <id property="id" column="ID"/>
    <result property="taskId" column="TASK_ID"/>
    <result property="archiveDetailId" column="ARCHIVE_DETAIL_ID"/>
  </resultMap>
    <sql id="Base_Column_List">
                a.ID,
                a.TASK_ID,
                a.ARCHIVE_DETAIL_ID
    </sql>
    <sql id="tTaskArchiveRelation_where">
        <if test="tTaskArchiveRelation != null">
                    <if test="tTaskArchiveRelation.id != null and tTaskArchiveRelation.id.trim() != ''">
                        AND a.ID = #{tTaskArchiveRelation.id}
                    </if>
                    <if test="tTaskArchiveRelation.taskId != null and tTaskArchiveRelation.taskId.trim() != ''">
                        AND a.TASK_ID = #{tTaskArchiveRelation.taskId}
                    </if>
                    <if test="tTaskArchiveRelation.archiveDetailId != null and tTaskArchiveRelation.archiveDetailId.trim() != ''">
                        AND a.ARCHIVE_DETAIL_ID = #{tTaskArchiveRelation.archiveDetailId}
                    </if>
        </if>
    </sql>
    <!--tTaskArchiveRelation简单分页查询-->
    <select id="getTTaskArchiveRelationPage" resultMap="tTaskArchiveRelationMap">
        SELECT
        <include refid="Base_Column_List"/>
        FROM t_task_archive_relation a
        <where>
            1=1
            <include refid="tTaskArchiveRelation_where"/>
        </where>
    </select>
</mapper>
