package com.ssj.dao.sys.attendance;

import com.ssj.bean.sys.attendance.Attendance;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author Mount Liu
 * @date 2019/6/4
 */
@Repository
public interface AttendanceDao extends JpaRepository<Attendance, String> {
    /**
     * 查询指定天的数据
     *
     * @param userId
     * @param oneDay
     * @return
     */
    @Query(nativeQuery = true, value = "select * from tb_attendance where user_id = ?1 and create_time REGEXP ?2 limit 1")
    Attendance findTopByUserIdAndCreateTimeLike(String userId,String oneDay);

}
