<?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.ruoyi.wgz.mapper.WgzLeaveMapper">

    <resultMap type="com.ruoyi.wgz.domain.WgzLeave" id="WgzLeaveResult">
        <result property="id" column="id"/>
        <result property="recruitId" column="recruit_id"/>
        <result property="subject" column="subject"/>
        <result property="leaveType" column="leave_type"/>
        <result property="startTime" column="start_time"/>
        <result property="endTime" column="end_time"/>
        <result property="reason" column="reason"/>
        <result property="auditorUserId" column="auditor_user_id"/>
        <result property="auditorType" column="auditor_type"/>
        <result property="auditorOpinion" column="auditor_opinion"/>
        <result property="auditorTime" column="auditor_time"/>
        <result property="workingTime" column="working_time"/>
        <result property="closingTime" column="closing_time"/>
        <result property="delFlag" column="del_flag"/>
        <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>

    <select id="userLeaveHistoryListPage" resultType="com.ruoyi.wgz.bo.res.WgzAppLeaveHistoryListPageRes">
        SELECT
            a.*,
            b.username,
            b.avatar_name
        FROM
            wgz_leave a
                LEFT JOIN bgt_user b ON (a.auditor_user_id = b.user_id and b.del_flag = 0)
        WHERE
            a.del_flag = 0
        ORDER BY
            a.id DESC
    </select>


</mapper>
