<?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.hotent.baseInfo.dao.CostDocumentTemplateDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.baseInfo.model.CostDocumentTemplate">
        <id column="id" property="id"/>
        <result column="document_name" property="documentName"/>
        <result column="alias" property="alias"/>
        <result column="type" property="type"/>
        <result column="data_source_type" property="dataSourceType"/>
        <result column="file_url" property="fileUrl"/>
        <result column="version_details" property="versionDetails"/>
        <result column="description" property="description"/>
        <result column="status" property="status"/>
        <result column="is_deleted" property="isDeleted"/>
        <result column="create_time" property="createTime"/>
        <result column="create_by" property="createBy"/>
        <result column="update_time" property="updateTime"/>
        <result column="update_by" property="updateBy"/>
        <result column="table_id" property="tableId"/>
        <result column="is_wh" property="isWh"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        , document_name, alias, type, data_source_type, file_url, version_details, description, status, is_deleted,is_wh, create_time, create_by, update_time, update_by, table_id
    </sql>

    <select id="selectPage" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        cost_document_template
        ${ew.customSqlSegment}
    </select>

    <select id="selectList" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        cost_document_template
        ${ew.customSqlSegment}
    </select>

    <select id="selectById" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from
        cost_document_template
        where
        id = ${id}
    </select>
</mapper>
