package com.template.services.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.template.mapper.SmartAuthorGroupMapper;
import com.template.model.pojo.SmartAttendance;
import com.template.mapper.SmartAttendanceMapper;
import com.template.services.SmartAttendanceService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

/**
 * <p>
 * 楼栋表 服务实现类
 * </p>
 *
 * @author ceshi
 * @since 2023-12-25
 */
@Service
public class SmartAttendanceServiceImpl extends ServiceImpl<SmartAttendanceMapper, SmartAttendance> implements SmartAttendanceService {

    @Autowired
    private SmartAttendanceMapper smartAttendanceMapper;

    @Override
    public List<SmartAttendance> queryAttendances(String startDate, String endDate) {

        QueryWrapper<SmartAttendance> queryWrapper = new QueryWrapper<>();
        queryWrapper.ge(StringUtils.hasText(startDate), "attend_time", startDate);//大于等于
        queryWrapper.le(StringUtils.hasText(endDate), "attend_time", endDate);//小于等于

        List<SmartAttendance> result = smartAttendanceMapper.selectList(queryWrapper);
        return result;
    }
}
