package cn.com.ty.lift.enterprise.oa.service;

import cn.com.ty.lift.enterprise.oa.entity.AttendanceImg;
import cn.com.ty.lift.enterprise.oa.mapper.AttendanceImgMapper;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 打卡签到图片 服务实现类
 * </p>
 *
 * @author wcz
 * @since 2019-12-12
 */
@Service
public class AttendanceImgService extends ServiceImpl<AttendanceImgMapper, AttendanceImg> {

    /**
     * 根据打卡记录id查询图片
     * @param attendanceId 打卡记录id
     * @return List<AttendanceImg> 图片列表
     */
    public List<AttendanceImg> listByAttendance(Long attendanceId){
        LambdaQueryWrapper<AttendanceImg> lambdaQueryWrapper = Wrappers.lambdaQuery();
        lambdaQueryWrapper.eq(AttendanceImg::getAttendanceId,attendanceId);
        return list(lambdaQueryWrapper);
    }
}
