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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.project.model.CostVerifyProjectTemplate">
        <id column="survey_template_id" property="surveyTemplateId" />
    <result column="survey_template_name" property="surveyTemplateName" />
    <result column="survey_template_name_yw" property="surveyTemplateNameYw" />
    <result column="template_type" property="templateType" />
    <result column="storage_table" property="storageTable" />
    <result column="status" property="status" />
    <result column="catalog_id" property="catalogId" />
    <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="content_type" property="contentType" />
    <result column="type" property="type" />
    <result column="remarks" property="remarks" />
    <result column="is_delete" property="isDelete" />
    <result column="area_code" property="areaCode" />
    <result column="area_level" property="areaLevel" />
    <result column="version_no" property="versionNo" />
    <result column="createmode" property="createmode" />
    <result column="createtemplateid" property="createtemplateid" />
    <result column="task_id" property="taskId" />
        <result column="version_id" property="versionId" />
        <result column="orgin_survey_template_id" property="orginSurveyTemplateId" />
        <result column="audituser" property="audituser" />
        <result column="auditstate" property="auditstate" />
        <result column="project_id" property="projectId" />
        <result column="auxiliary_audituser" property="auxiliaryAudituser" />

    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        survey_template_id, survey_template_name, survey_template_name_yw, template_type, storage_table, status, catalog_id, create_time, create_by, update_time, update_by, content_type, type, remarks, is_delete, area_code, area_level, version_no, createmode, createtemplateid, task_id, version_id , orgin_survey_template_id, audituser, auditstate, project_id, auxiliary_audituser
    </sql>

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