package org.jeecg.modules.clockInprojectitem.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.jeecg.modules.clockInprojectitem.entity.ClockInProjectItem;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;

/**
 * @Description: clock_in_project_item
 * @Author: jeecg-boot
 * @Date:   2024-11-05
 * @Version: V1.0
 */
public interface ClockInProjectItemMapper extends BaseMapper<ClockInProjectItem> {


    /**
     * 获取有效打卡时间范围
     * @param time
     * @param projectId
     * @return
     */
    @Select("SELECT * FROM clock_in_project_item WHERE del_flag = 0 AND clock_start_time <= #{time} AND clock_end_time >= #{time} AND project_id = #{projectId} AND type in ('${type},2') ")
    ClockInProjectItem getValidClockInTime(@Param("time") String time,@Param("projectId") String projectId,@Param("type") Integer type);

}
