@@ -8,12 +8,13 @@ import com.ruoyi.zhushi.entity.DkCheckInRecordDTO; | |||
import org.apache.ibatis.annotations.Mapper; | |||
import org.apache.ibatis.annotations.Param; | |||
import java.time.LocalDate; | |||
import java.util.List; | |||
@Mapper | |||
public interface DkRecordMapper extends BaseMapperPlus<DkRecordMapper, DkCheckInRecord, DkCheckInRecordDTO> { | |||
public List<DkCheckInRecord> getCurrentDayRecord(@Param("userId") long userId); | |||
public List<DkCheckInRecord> getCurrentDayRecord(@Param("userId") long userId, @Param("currentDate") LocalDate currentDate); | |||
public List<DkCheckInRecord> queryCurrentDayOutRecord(@Param("userId") long userId); | |||
@@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; | |||
import org.springframework.stereotype.Service; | |||
import java.time.Duration; | |||
import java.time.LocalDate; | |||
import java.time.LocalTime; | |||
import java.time.format.DateTimeFormatter; | |||
import java.time.format.DateTimeParseException; | |||
@@ -352,8 +353,8 @@ public class DkAppServiceImpl implements DkAppService { | |||
@Override | |||
public List<DkCheckInRecord> getCurrentDayRecord(AppDTO appDTO) { | |||
List<DkCheckInRecord> currentDayRecords = dkRecordMapper.getCurrentDayRecord(appDTO.getUserId()); | |||
LocalDate currentDate = LocalDate.now(); | |||
List<DkCheckInRecord> currentDayRecords = dkRecordMapper.getCurrentDayRecord(appDTO.getUserId(), currentDate); | |||
return currentDayRecords; | |||
} | |||
} |
@@ -22,6 +22,10 @@ | |||
<if test="userId != null and userId != ''"> | |||
AND sys_user_id = #{userId} | |||
</if> | |||
<if test="currentDate != null "> | |||
AND create_time = #{currentDate} | |||
</if> | |||
</where> | |||
</select> | |||