<?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.zehong.system.mapper.TProAppInforMapper">
    
    <resultMap type="TProAppInfor" id="TProAppInforResult">
        <result property="fProAppInforId"    column="f_pro_app_infor_id"    />
        <result property="fDeptCode"    column="f_dept_code"    />
        <result property="fSource"    column="f_source"    />
        <result property="fCode"    column="f_code"    />
        <result property="fName"    column="f_name"    />
        <result property="fIdNo"    column="f_id_no"    />
        <result property="fSex"    column="f_sex"    />
        <result property="fBirthday"    column="f_birthday"    />
        <result property="fEmail"    column="f_email"    />
        <result property="fPhone"    column="f_phone"    />
        <result property="fEducation"    column="f_education"    />
        <result property="fGraduationSchool"    column="f_graduation_school"    />
        <result property="fMajor"    column="f_major"    />
        <result property="fGraduationTime"    column="f_graduation_time"    />
        <result property="fEntUuid"    column="f_ent_uuid"    />
        <result property="fWorkUnit"    column="f_work_unit"    />
        <result property="fWorkTime"    column="f_work_time"    />
        <result property="fDepartment"    column="f_department"    />
        <result property="fDuties"    column="f_duties"    />
        <result property="fMajorTitle"    column="f_major_title"    />
        <result property="fMajorNow"    column="f_major_now"    />
        <result property="fMajorLife"    column="f_major_life"    />
        <result property="fGasType"    column="f_gas_type"    />
        <result property="fGoodArea"    column="f_good_area"    />
        <result property="fLearningWorkExperience"    column="f_learning_work_experience"    />
        <result property="fArea"    column="f_area"    />
        <result property="fDeleteFlag"    column="f_delete_flag"    />
        <result property="fCRecord"    column="f_c_record"    />
        <result property="fPRecord"    column="f_p_record"    />
        <result property="fPicture"    column="f_picture"    />
        <result property="fUpdateTime"    column="f_update_time"    />
        <result property="fThisProvinceFlag"    column="f_this_province_flag"    />
        <result property="fValidType"    column="f_valid_type"    />
        <result property="fRepStatus"    column="f_rep_status"    />
        <result property="fRepDate"    column="f_rep_date"    />
    </resultMap>

    <sql id="selectTProAppInforVo">
        select f_pro_app_infor_id, f_dept_code, f_source, f_code, f_name, f_id_no, f_sex, f_birthday, f_email, f_phone, f_education, f_graduation_school, f_major, f_graduation_time, f_ent_uuid, f_work_unit, f_work_time, f_department, f_duties, f_major_title, f_major_now, f_major_life, f_gas_type, f_good_area, f_learning_work_experience, f_area, f_delete_flag, f_c_record, f_p_record, f_picture, f_update_time, f_this_province_flag, f_valid_type, f_rep_status, f_rep_date from t_pro_app_infor
    </sql>

    <select id="selectTProAppInforList" parameterType="TProAppInfor" resultMap="TProAppInforResult">
        <include refid="selectTProAppInforVo"/>
        <where>  
            <if test="fDeptCode != null  and fDeptCode != ''"> and f_dept_code = #{fDeptCode}</if>
            <if test="fSource != null  and fSource != ''"> and f_source = #{fSource}</if>
            <if test="fCode != null  and fCode != ''"> and f_code like concat('%', #{fCode}, '%')</if>
            <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
            <if test="fIdNo != null  and fIdNo != ''"> and f_id_no like concat('%', #{fIdNo}, '%')</if>
            <if test="fSex != null  and fSex != ''"> and f_sex = #{fSex}</if>
            <if test="fBirthday != null  and fBirthday != ''"> and f_birthday = #{fBirthday}</if>
            <if test="fEmail != null  and fEmail != ''"> and f_email = #{fEmail}</if>
            <if test="fPhone != null  and fPhone != ''"> and f_phone = #{fPhone}</if>
            <if test="fEducation != null  and fEducation != ''"> and f_education = #{fEducation}</if>
            <if test="fGraduationSchool != null  and fGraduationSchool != ''"> and f_graduation_school = #{fGraduationSchool}</if>
            <if test="fMajor != null  and fMajor != ''"> and f_major = #{fMajor}</if>
            <if test="fGraduationTime != null  and fGraduationTime != ''"> and f_graduation_time = #{fGraduationTime}</if>
            <if test="fEntUuid != null  and fEntUuid != ''"> and f_ent_uuid = #{fEntUuid}</if>
            <if test="fWorkUnit != null  and fWorkUnit != ''"> and f_work_unit = #{fWorkUnit}</if>
            <if test="fWorkTime != null  and fWorkTime != ''"> and f_work_time = #{fWorkTime}</if>
            <if test="fDepartment != null  and fDepartment != ''"> and f_department = #{fDepartment}</if>
            <if test="fDuties != null  and fDuties != ''"> and f_duties = #{fDuties}</if>
            <if test="fMajorTitle != null  and fMajorTitle != ''"> and f_major_title = #{fMajorTitle}</if>
            <if test="fMajorNow != null  and fMajorNow != ''"> and f_major_now = #{fMajorNow}</if>
            <if test="fMajorLife != null "> and f_major_life = #{fMajorLife}</if>
            <if test="fGasType != null  and fGasType != ''"> and f_gas_type = #{fGasType}</if>
            <if test="fGoodArea != null  and fGoodArea != ''"> and f_good_area = #{fGoodArea}</if>
            <if test="fLearningWorkExperience != null  and fLearningWorkExperience != ''"> and f_learning_work_experience = #{fLearningWorkExperience}</if>
            <if test="fArea != null  and fArea != ''"> and f_area = #{fArea}</if>
            <if test="fDeleteFlag != null "> and f_delete_flag = #{fDeleteFlag}</if>
            <if test="fCRecord != null  and fCRecord != ''"> and f_c_record = #{fCRecord}</if>
            <if test="fPRecord != null  and fPRecord != ''"> and f_p_record = #{fPRecord}</if>
            <if test="fPicture != null  and fPicture != ''"> and f_picture = #{fPicture}</if>
            <if test="fUpdateTime != null  and fUpdateTime != ''"> and f_update_time = #{fUpdateTime}</if>
            <if test="fThisProvinceFlag != null  and fThisProvinceFlag != ''"> and f_this_province_flag = #{fThisProvinceFlag}</if>
            <if test="fValidType != null "> and f_valid_type = #{fValidType}</if>
            <if test="fRepStatus != null "> and f_rep_status = #{fRepStatus}</if>
            <if test="fRepDate != null  and fRepDate != ''"> and f_rep_date = #{fRepDate}</if>
        </where>
        ORDER BY f_update_time DESC
    </select>
    
    <select id="selectTProAppInforById" parameterType="Long" resultMap="TProAppInforResult">
        <include refid="selectTProAppInforVo"/>
        where f_pro_app_infor_id = #{fProAppInforId}
    </select>
        
    <insert id="insertTProAppInfor" parameterType="TProAppInfor" useGeneratedKeys="true" keyProperty="fProAppInforId">
        insert into t_pro_app_infor
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fDeptCode != null and fDeptCode != ''">f_dept_code,</if>
            <if test="fSource != null and fSource != ''">f_source,</if>
            <if test="fCode != null and fCode != ''">f_code,</if>
            <if test="fName != null and fName != ''">f_name,</if>
            <if test="fIdNo != null and fIdNo != ''">f_id_no,</if>
            <if test="fSex != null">f_sex,</if>
            <if test="fBirthday != null">f_birthday,</if>
            <if test="fEmail != null">f_email,</if>
            <if test="fPhone != null and fPhone != ''">f_phone,</if>
            <if test="fEducation != null">f_education,</if>
            <if test="fGraduationSchool != null">f_graduation_school,</if>
            <if test="fMajor != null and fMajor != ''">f_major,</if>
            <if test="fGraduationTime != null">f_graduation_time,</if>
            <if test="fEntUuid != null">f_ent_uuid,</if>
            <if test="fWorkUnit != null">f_work_unit,</if>
            <if test="fWorkTime != null">f_work_time,</if>
            <if test="fDepartment != null">f_department,</if>
            <if test="fDuties != null">f_duties,</if>
            <if test="fMajorTitle != null and fMajorTitle != ''">f_major_title,</if>
            <if test="fMajorNow != null and fMajorNow != ''">f_major_now,</if>
            <if test="fMajorLife != null">f_major_life,</if>
            <if test="fGasType != null and fGasType != ''">f_gas_type,</if>
            <if test="fGoodArea != null and fGoodArea != ''">f_good_area,</if>
            <if test="fLearningWorkExperience != null">f_learning_work_experience,</if>
            <if test="fArea != null and fArea != ''">f_area,</if>
            <if test="fDeleteFlag != null">f_delete_flag,</if>
            <if test="fCRecord != null">f_c_record,</if>
            <if test="fPRecord != null">f_p_record,</if>
            <if test="fPicture != null">f_picture,</if>
            <if test="fUpdateTime != null">f_update_time,</if>
            <if test="fThisProvinceFlag != null">f_this_province_flag,</if>
            <if test="fValidType != null">f_valid_type,</if>
            <if test="fRepStatus != null">f_rep_status,</if>
            <if test="fRepDate != null">f_rep_date,</if>
         </trim>
        <trim prefix="values (" suffix=")" suffixOverrides=",">
            <if test="fDeptCode != null and fDeptCode != ''">#{fDeptCode},</if>
            <if test="fSource != null and fSource != ''">#{fSource},</if>
            <if test="fCode != null and fCode != ''">#{fCode},</if>
            <if test="fName != null and fName != ''">#{fName},</if>
            <if test="fIdNo != null and fIdNo != ''">#{fIdNo},</if>
            <if test="fSex != null">#{fSex},</if>
            <if test="fBirthday != null">#{fBirthday},</if>
            <if test="fEmail != null">#{fEmail},</if>
            <if test="fPhone != null and fPhone != ''">#{fPhone},</if>
            <if test="fEducation != null">#{fEducation},</if>
            <if test="fGraduationSchool != null">#{fGraduationSchool},</if>
            <if test="fMajor != null and fMajor != ''">#{fMajor},</if>
            <if test="fGraduationTime != null">#{fGraduationTime},</if>
            <if test="fEntUuid != null">#{fEntUuid},</if>
            <if test="fWorkUnit != null">#{fWorkUnit},</if>
            <if test="fWorkTime != null">#{fWorkTime},</if>
            <if test="fDepartment != null">#{fDepartment},</if>
            <if test="fDuties != null">#{fDuties},</if>
            <if test="fMajorTitle != null and fMajorTitle != ''">#{fMajorTitle},</if>
            <if test="fMajorNow != null and fMajorNow != ''">#{fMajorNow},</if>
            <if test="fMajorLife != null">#{fMajorLife},</if>
            <if test="fGasType != null and fGasType != ''">#{fGasType},</if>
            <if test="fGoodArea != null and fGoodArea != ''">#{fGoodArea},</if>
            <if test="fLearningWorkExperience != null">#{fLearningWorkExperience},</if>
            <if test="fArea != null and fArea != ''">#{fArea},</if>
            <if test="fDeleteFlag != null">#{fDeleteFlag},</if>
            <if test="fCRecord != null">#{fCRecord},</if>
            <if test="fPRecord != null">#{fPRecord},</if>
            <if test="fPicture != null">#{fPicture},</if>
            <if test="fUpdateTime != null">#{fUpdateTime},</if>
            <if test="fThisProvinceFlag != null">#{fThisProvinceFlag},</if>
            <if test="fValidType != null">#{fValidType},</if>
            <if test="fRepStatus != null">#{fRepStatus},</if>
            <if test="fRepDate != null">#{fRepDate},</if>
         </trim>
    </insert>

    <update id="updateTProAppInfor" parameterType="TProAppInfor">
        update t_pro_app_infor
        <trim prefix="SET" suffixOverrides=",">
            <if test="fDeptCode != null and fDeptCode != ''">f_dept_code = #{fDeptCode},</if>
            <if test="fSource != null and fSource != ''">f_source = #{fSource},</if>
            <if test="fCode != null and fCode != ''">f_code = #{fCode},</if>
            <if test="fName != null and fName != ''">f_name = #{fName},</if>
            <if test="fIdNo != null and fIdNo != ''">f_id_no = #{fIdNo},</if>
            <if test="fSex != null">f_sex = #{fSex},</if>
            <if test="fBirthday != null">f_birthday = #{fBirthday},</if>
            <if test="fEmail != null">f_email = #{fEmail},</if>
            <if test="fPhone != null and fPhone != ''">f_phone = #{fPhone},</if>
            <if test="fEducation != null">f_education = #{fEducation},</if>
            <if test="fGraduationSchool != null">f_graduation_school = #{fGraduationSchool},</if>
            <if test="fMajor != null and fMajor != ''">f_major = #{fMajor},</if>
            <if test="fGraduationTime != null">f_graduation_time = #{fGraduationTime},</if>
            <if test="fEntUuid != null">f_ent_uuid = #{fEntUuid},</if>
            <if test="fWorkUnit != null">f_work_unit = #{fWorkUnit},</if>
            <if test="fWorkTime != null">f_work_time = #{fWorkTime},</if>
            <if test="fDepartment != null">f_department = #{fDepartment},</if>
            <if test="fDuties != null">f_duties = #{fDuties},</if>
            <if test="fMajorTitle != null and fMajorTitle != ''">f_major_title = #{fMajorTitle},</if>
            <if test="fMajorNow != null and fMajorNow != ''">f_major_now = #{fMajorNow},</if>
            <if test="fMajorLife != null">f_major_life = #{fMajorLife},</if>
            <if test="fGasType != null and fGasType != ''">f_gas_type = #{fGasType},</if>
            <if test="fGoodArea != null and fGoodArea != ''">f_good_area = #{fGoodArea},</if>
            <if test="fLearningWorkExperience != null">f_learning_work_experience = #{fLearningWorkExperience},</if>
            <if test="fArea != null and fArea != ''">f_area = #{fArea},</if>
            <if test="fDeleteFlag != null">f_delete_flag = #{fDeleteFlag},</if>
            <if test="fCRecord != null">f_c_record = #{fCRecord},</if>
            <if test="fPRecord != null">f_p_record = #{fPRecord},</if>
            <if test="fPicture != null">f_picture = #{fPicture},</if>
            <if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
            <if test="fThisProvinceFlag != null">f_this_province_flag = #{fThisProvinceFlag},</if>
            <if test="fValidType != null">f_valid_type = #{fValidType},</if>
            <if test="fRepStatus != null">f_rep_status = #{fRepStatus},</if>
            <if test="fRepDate != null">f_rep_date = #{fRepDate},</if>
        </trim>
        where f_pro_app_infor_id = #{fProAppInforId}
    </update>

    <delete id="deleteTProAppInforById" parameterType="Long">
        delete from t_pro_app_infor where f_pro_app_infor_id = #{fProAppInforId}
    </delete>

    <delete id="deleteTProAppInforByIds" parameterType="String">
        delete from t_pro_app_infor where f_pro_app_infor_id in 
        <foreach item="fProAppInforId" collection="array" open="(" separator="," close=")">
            #{fProAppInforId}
        </foreach>
    </delete>
</mapper>