<?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.willalp.vacation.mapper.HsProbationPeriodScoreMapper">

    <resultMap type="com.willalp.vacation.domain.HsProbationPeriodScore" id="HsProbationPeriodScoreResult">
                    <result property="id" column="id"/>
                    <result property="name" column="name"/>
                    <result property="jobNo" column="job_no"/>
                    <result property="department" column="department"/>
                    <result property="startTime" column="start_time"/>
                    <result property="endTime" column="end_time"/>
                    <result property="examEvaluateOne" column="exam_evaluate_one"/>
                    <result property="scoreOne" column="score_one"/>
                    <result property="examEvaluateTwo" column="exam_evaluate_two"/>
                    <result property="scoreTwo" column="score_two"/>
                    <result property="examEvaluateThree" column="exam_evaluate_three"/>
                    <result property="scoreThree" column="score_three"/>
                    <result property="managerOpinion" column="manager_opinion"/>
                    <result property="postOpinion" column="post_opinion"/>
                    <result property="postScore" column="post_score"/>
                    <result property="kpiOpinion" column="kpi_opinion"/>
                    <result property="kpiScore" column="kpi_score"/>
                    <result property="hrOpinion" column="hr_opinion"/>
                    <result property="hrScore" column="hr_score"/>
                    <result property="totalScore" column="total_score"/>
                    <result property="result" column="result"/>
                    <result property="examEvaluateNo" column="exam_evaluate_no"/>
                    <result property="isDelete" column="is_delete"/>
                    <result property="createBy" column="create_by"/>
                    <result property="createTime" column="create_time"/>
                    <result property="updateBy" column="update_by"/>
                    <result property="updateTime" column="update_time"/>
                    <result property="remark" column="remark"/>
            </resultMap>
    
    <sql id="selectHsProbationPeriodScoreVo">
        select id, name, job_no, department, start_time, end_time, exam_evaluate_one, score_one, exam_evaluate_two, score_two, exam_evaluate_three, score_three, manager_opinion, post_opinion, post_score, kpi_opinion, kpi_score, hr_opinion, hr_score, total_score, result, exam_evaluate_no, is_delete, create_by, create_time, update_by, update_time, remark        from hs_probation_period_score
    </sql>

    <select id="selectHsProbationPeriodScoreList" parameterType="HsProbationPeriodScore" resultMap="HsProbationPeriodScoreResult">
        <include refid="selectHsProbationPeriodScoreVo"/>
        <where>
            is_delete = 0
                                                                                                    <if test="name != null  and name != ''">
                            and name like concat('%', #{name}, '%')
                        </if>
                                                                                                            <if test="jobNo != null  and jobNo != ''">
                            and job_no = #{jobNo}
                        </if>
                                                                                                            <if test="department != null  and department != ''">
                            and department = #{department}
                        </if>
                                                                                                            <if test="startTime != null ">
                            and start_time = #{startTime}
                        </if>
                                                                                                            <if test="endTime != null ">
                            and end_time = #{endTime}
                        </if>
                                                                                                            <if test="examEvaluateOne != null  and examEvaluateOne != ''">
                            and exam_evaluate_one = #{examEvaluateOne}
                        </if>
                                                                                                            <if test="scoreOne != null  and scoreOne != ''">
                            and score_one = #{scoreOne}
                        </if>
                                                                                                            <if test="examEvaluateTwo != null  and examEvaluateTwo != ''">
                            and exam_evaluate_two = #{examEvaluateTwo}
                        </if>
                                                                                                            <if test="scoreTwo != null  and scoreTwo != ''">
                            and score_two = #{scoreTwo}
                        </if>
                                                                                                            <if test="examEvaluateThree != null  and examEvaluateThree != ''">
                            and exam_evaluate_three = #{examEvaluateThree}
                        </if>
                                                                                                            <if test="scoreThree != null  and scoreThree != ''">
                            and score_three = #{scoreThree}
                        </if>
                                                                                                            <if test="managerOpinion != null  and managerOpinion != ''">
                            and manager_opinion = #{managerOpinion}
                        </if>
                                                                                                            <if test="postOpinion != null  and postOpinion != ''">
                            and post_opinion = #{postOpinion}
                        </if>
                                                                                                            <if test="postScore != null  and postScore != ''">
                            and post_score = #{postScore}
                        </if>
                                                                                                            <if test="kpiOpinion != null  and kpiOpinion != ''">
                            and kpi_opinion = #{kpiOpinion}
                        </if>
                                                                                                            <if test="kpiScore != null  and kpiScore != ''">
                            and kpi_score = #{kpiScore}
                        </if>
                                                                                                            <if test="hrOpinion != null  and hrOpinion != ''">
                            and hr_opinion = #{hrOpinion}
                        </if>
                                                                                                            <if test="hrScore != null  and hrScore != ''">
                            and hr_score = #{hrScore}
                        </if>
                                                                                                            <if test="totalScore != null  and totalScore != ''">
                            and total_score = #{totalScore}
                        </if>
                                                                                                            <if test="result != null  and result != ''">
                            and result = #{result}
                        </if>
                                                                                                            <if test="examEvaluateNo != null  and examEvaluateNo != ''">
                            and exam_evaluate_no = #{examEvaluateNo}
                        </if>
                                                                                                            <if test="isDelete != null ">
                            and is_delete = #{isDelete}
                        </if>
                                                                                                                                                                                                    </where>
    </select>
</mapper>
