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

    <!-- 通用查询映射结果 -->
    <resultMap id="BaseResultMap" type="com.hotent.project.model.CostSurveyFdProjectHeaders">
        <id column="id" property="id" />
    <result column="survey_template_id" property="surveyTemplateId" />
    <result column="field_name" property="fieldName" />
    <result column="field_type" property="fieldType" />
    <result column="field_typelen" property="fieldTypelen" />
    <result column="field_typenointlen" property="fieldTypenointlen" />
    <result column="format" property="format" />
    <result column="is_required" property="isRequired" />
    <result column="is_audit_period" property="isAuditPeriod" />
    <result column="is_dict" property="isDict" />
    <result column="order_num" property="orderNum" />
    <result column="dictid" property="dictid" />
    <result column="dict_code" property="dictCode" />
    <result column="area_code" property="areaCode" />
    <result column="area_level" property="areaLevel" />
    <result column="tabtype" property="tabtype" />
    <result column="column_comment" property="columnComment" />
    <result column="column_type" property="columnType" />
    <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="version_id" property="versionId" />
    <result column="field_ename" property="fieldEname" />
    <result column="task_id" property="taskId" />
    <result column="showVisible" property="showVisible" />
        <result column="orgin_survey_template_id" property="orginSurveyTemplateId" />
        <result column="orgin_id" property="orginId" />
        <result column="project_id" property="projectId" />


    </resultMap>

    <!-- 通用查询结果列 -->
    <sql id="Base_Column_List">
        id, survey_template_id, field_name, field_type, field_typelen, field_typenointlen, format, is_required, is_audit_period, is_dict, order_num, dictid, dict_code, area_code, area_level, tabtype, column_comment, column_type, create_time, create_by, update_time, update_by, version_id, field_ename, task_id, showVisible , orgin_survey_template_id, orgin_id, project_id
    </sql>

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