<?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="org.dromara.zjk.mapper.ZjkLeaveRuleMapper">

    <resultMap id="BaseResultMap" type="org.dromara.zjk.domain.ZjkLeaveRule">
            <result property="gid" column="GID" jdbcType="VARCHAR"/>
            <result property="leaveDay" column="leave_day" jdbcType="OTHER"/>
            <result property="beforeDay" column="before_day" jdbcType="VARCHAR"/>
            <result property="proBeforeHour" column="pro_before_hour" jdbcType="VARCHAR"/>
            <result property="tenantId" column="tenant_id" jdbcType="VARCHAR"/>
            <result property="createdBy" column="CREATED_BY" jdbcType="VARCHAR"/>
            <result property="createdTime" column="CREATED_TIME" jdbcType="DATE"/>
            <result property="updatedBy" column="UPDATED_BY" jdbcType="VARCHAR"/>
            <result property="updatedTime" column="UPDATED_TIME" jdbcType="DATE"/>
    </resultMap>

    <sql id="Base_Column_List">
        GID,leave_day,before_day,
        pro_before_hour,tenant_id,CREATED_BY,
        CREATED_TIME,UPDATED_BY,UPDATED_TIME
    </sql>
    <select id="checkLeaveRange" resultType="org.dromara.zjk.domain.vo.ZjkLeaveVo">
        select min(start_date) as start_date,max(end_date) as end_date  from zjk_leave where create_by=#{userId} and status!=1
    </select>
    <select id="selectRuleByTannet" resultType="org.dromara.zjk.domain.vo.ZjkLeaveRuleVo">
        select * from zjk_leave_rule where tenant_id=#{tenantId}
    </select>
</mapper>
