<?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.FProBehInforMapper">
    
    <resultMap type="FProBehInfor" id="FProBehInforResult">
        <result property="fProBehInforId"    column="f_pro_beh_infor_id"    />
        <result property="fIdNo"    column="f_id_no"    />
        <result property="fName"    column="f_name"    />
        <result property="fExpertEval"    column="f_expert_eval"    />
        <result property="fSelectionEvent"    column="f_selection_event"    />
        <result property="fSelectionStartTime"    column="f_selection_start_time"    />
        <result property="fScorDesc"    column="f_scor_desc"    />
        <result property="fUpdateTime"    column="f_update_time"    />
        <result property="fRepStatus"    column="f_rep_status"    />
        <result property="fRepDate"    column="f_rep_date"    />
    </resultMap>

    <sql id="selectFProBehInforVo">
        select f_pro_beh_infor_id, f_id_no, f_name, f_expert_eval, f_selection_event, f_selection_start_time, f_scor_desc, f_update_time, f_rep_status, f_rep_date from f_pro_beh_infor
    </sql>

    <select id="selectFProBehInforList" parameterType="FProBehInfor" resultMap="FProBehInforResult">
        <include refid="selectFProBehInforVo"/>
        <where>  
            <if test="fIdNo != null  and fIdNo != ''"> and f_id_no like concat('%', #{fIdNo}, '%')</if>
            <if test="fName != null  and fName != ''"> and f_name like concat('%', #{fName}, '%')</if>
            <if test="fRepStatus != null "> and f_rep_status = #{fRepStatus}</if>
        </where>
        ORDER BY f_update_time DESC
    </select>
    
    <select id="selectFProBehInforById" parameterType="Long" resultMap="FProBehInforResult">
        <include refid="selectFProBehInforVo"/>
        where f_pro_beh_infor_id = #{fProBehInforId}
    </select>
        
    <insert id="insertFProBehInfor" parameterType="FProBehInfor" useGeneratedKeys="true" keyProperty="fProBehInforId">
        insert into f_pro_beh_infor
        <trim prefix="(" suffix=")" suffixOverrides=",">
            <if test="fIdNo != null and fIdNo != ''">f_id_no,</if>
            <if test="fName != null and fName != ''">f_name,</if>
            <if test="fExpertEval != null and fExpertEval != ''">f_expert_eval,</if>
            <if test="fSelectionEvent != null">f_selection_event,</if>
            <if test="fSelectionStartTime != null">f_selection_start_time,</if>
            <if test="fScorDesc != null">f_scor_desc,</if>
            <if test="fUpdateTime != null">f_update_time,</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="fIdNo != null and fIdNo != ''">#{fIdNo},</if>
            <if test="fName != null and fName != ''">#{fName},</if>
            <if test="fExpertEval != null and fExpertEval != ''">#{fExpertEval},</if>
            <if test="fSelectionEvent != null">#{fSelectionEvent},</if>
            <if test="fSelectionStartTime != null">#{fSelectionStartTime},</if>
            <if test="fScorDesc != null">#{fScorDesc},</if>
            <if test="fUpdateTime != null">#{fUpdateTime},</if>
            <if test="fRepStatus != null">#{fRepStatus},</if>
            <if test="fRepDate != null">#{fRepDate},</if>
         </trim>
    </insert>

    <update id="updateFProBehInfor" parameterType="FProBehInfor">
        update f_pro_beh_infor
        <trim prefix="SET" suffixOverrides=",">
            <if test="fIdNo != null and fIdNo != ''">f_id_no = #{fIdNo},</if>
            <if test="fName != null and fName != ''">f_name = #{fName},</if>
            <if test="fExpertEval != null and fExpertEval != ''">f_expert_eval = #{fExpertEval},</if>
            <if test="fSelectionEvent != null">f_selection_event = #{fSelectionEvent},</if>
            <if test="fSelectionStartTime != null">f_selection_start_time = #{fSelectionStartTime},</if>
            <if test="fScorDesc != null">f_scor_desc = #{fScorDesc},</if>
            <if test="fUpdateTime != null">f_update_time = #{fUpdateTime},</if>
            <if test="fRepStatus != null">f_rep_status = #{fRepStatus},</if>
            <if test="fRepDate != null">f_rep_date = #{fRepDate},</if>
        </trim>
        where f_pro_beh_infor_id = #{fProBehInforId}
    </update>

    <delete id="deleteFProBehInforById" parameterType="Long">
        delete from f_pro_beh_infor where f_pro_beh_infor_id = #{fProBehInforId}
    </delete>

    <delete id="deleteFProBehInforByIds" parameterType="String">
        delete from f_pro_beh_infor where f_pro_beh_infor_id in 
        <foreach item="fProBehInforId" collection="array" open="(" separator="," close=")">
            #{fProBehInforId}
        </foreach>
    </delete>
</mapper>