Преглед изворни кода

增加创建时间查询条件

main
1341924763@qq.com пре 1 дан
родитељ
комит
886413a4ef

+ 2
- 1
zs-manager/src/main/java/com/ruoyi/zhushi/mapper/DkRecordMapper.java Прегледај датотеку

@@ -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);


+ 3
- 2
zs-manager/src/main/java/com/ruoyi/zhushi/service/impl/DkAppServiceImpl.java Прегледај датотеку

@@ -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;
}
}

+ 4
- 0
zs-manager/src/main/resources/mapper/DkRecordMapper.xml Прегледај датотеку

@@ -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>


Loading…
Откажи
Сачувај