<?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.project.dao.CostProjectDocumentDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.project.model.CostProjectDocument">
        <id column="id" property="id"/>
        <result column="project_id" property="projectId"/>
        <result column="document_id" property="documentId"/>
        <result column="document_name" property="documentName"/>
        <result column="document_type" property="documentType"/>
        <result column="document_number" property="documentNumber"/>
        <result column="document_wh_id" property="documentWhId"/>
        <result column="document_alias" property="documentAlias"/>
        <result column="enterprise_id" property="enterpriseId"/>
        <result column="generate_time" property="generateTime"/>
        <result column="electronic_document_url" property="electronicDocumentUrl"/>
        <result column="scan_document_url" property="scanDocumentUrl"/>
        <result column="feedback_document_url" property="feedbackDocumentUrl"/>
        <result column="is_pushed" property="isPushed"/>
        <result column="push_time" property="pushTime"/>
        <result column="feedback_time" property="feedbackTime"/>
        <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="order_num" property="orderNum"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id
        , project_id, document_id,document_name,document_type,document_alias,document_number,document_wh_id, enterprise_id, generate_time, electronic_document_url, scan_document_url, feedback_document_url, is_pushed, push_time, feedback_time, is_deleted, create_time, create_by, update_time, update_by, order_num
    </sql>

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

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

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