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

    <resultMap type="com.willalp.vacation.domain.HsChangeOfficialRecord" id="HsChangeOfficialRecordResult">
                    <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="score" column="score"/>
                    <result property="managerOpinion" column="manager_opinion"/>
                    <result property="departmentOpinion" column="department_opinion"/>
                    <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="selectHsChangeOfficialRecordVo">
        select id, name, job_no, department, start_time, end_time, score, manager_opinion, department_opinion, result, exam_evaluate_no, is_delete, create_by, create_time, update_by, update_time, remark        from hs_change_official_record
    </sql>

    <select id="selectHsChangeOfficialRecordList" parameterType="HsChangeOfficialRecord" resultMap="HsChangeOfficialRecordResult">
        <include refid="selectHsChangeOfficialRecordVo"/>
        <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="score != null  and score != ''">
                            and score = #{score}
                        </if>
                                                                                                            <if test="managerOpinion != null  and managerOpinion != ''">
                            and manager_opinion = #{managerOpinion}
                        </if>
                                                                                                            <if test="departmentOpinion != null  and departmentOpinion != ''">
                            and department_opinion = #{departmentOpinion}
                        </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>
