<?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.CostProjectApprovalDao">

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.project.model.CostProjectApproval">
        <id column="project_id" property="projectId" />
    <result column="project_name" property="projectName" />
        <result column="audit_group" property="auditGroup" />
        <result  column="send_type" property="sendType"/>
    <result column="catalog_id" property="catalogId" />
    <result column="plan_id" property="planId" />
    <result column="area_code" property="areaCode" />
    <result column="area_level" property="areaLevel" />
    <result column="org_id" property="orgId" />
    <result column="project_year" property="projectYear" />
    <result column="source_type" property="sourceType" />
    <result column="audit_type" property="auditType" />
    <result column="audit_period" property="auditPeriod" />
    <result column="need_hearing" property="needHearing" />
    <result column="is_emergency" property="isEmergency" />
    <result column="establishment_reason" property="establishmentReason" />
    <result column="according_file_url" property="accordingFileUrl" />
    <result column="other_file_url" property="otherFileUrl" />
    <result column="status" property="status" />
    <result column="leader_id" property="leaderId" />
    <result column="expert_str" property="expertStr" />
    <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="project_members" property="projectMembers" />
        <result column="audited_unit_id" property="auditedUnitId"/>
        <result column="audited_unit_name" property="auditedUnitName"/>
        <result column="org_name" property="orgName"/>
    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        project_id, project_name,audited_unit_name,audit_group, send_type, audited_unit_id,catalog_id, plan_id, area_code, area_level, org_id,org_name, project_year, source_type, audit_type, audit_period, need_hearing, is_emergency, establishment_reason, according_file_url, other_file_url, status, leader_id, expert_str, is_deleted, create_time, create_by, update_time, update_by, project_members
    </sql>

	<select id="selectPage" resultMap="BaseResultMap">
		select 
			<include refid="Base_Column_List"/> 
		from
			cost_project_approval
		${ew.customSqlSegment}
	</select>
	
	<select id="selectList" resultMap="BaseResultMap">
		select 
			<include refid="Base_Column_List"/> 
		from
			cost_project_approval
		${ew.customSqlSegment}
	</select>
	
	<select id="selectById" resultMap="BaseResultMap">
		select 
			<include refid="Base_Column_List"/> 
		from
			cost_project_approval
		where 
		    project_id = ${projectId}
	</select>
</mapper>
