瀏覽代碼

增加创建时间查询条件

main
1341924763@qq.com 1 天之前
父節點
當前提交
886413a4ef

+ 2
- 1
zs-manager/src/main/java/com/ruoyi/zhushi/mapper/DkRecordMapper.java 查看文件

import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;


import java.time.LocalDate;
import java.util.List; import java.util.List;


@Mapper @Mapper
public interface DkRecordMapper extends BaseMapperPlus<DkRecordMapper, DkCheckInRecord, DkCheckInRecordDTO> { 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); public List<DkCheckInRecord> queryCurrentDayOutRecord(@Param("userId") long userId);



+ 3
- 2
zs-manager/src/main/java/com/ruoyi/zhushi/service/impl/DkAppServiceImpl.java 查看文件

import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;


import java.time.Duration; import java.time.Duration;
import java.time.LocalDate;
import java.time.LocalTime; import java.time.LocalTime;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException; import java.time.format.DateTimeParseException;


@Override @Override
public List<DkCheckInRecord> getCurrentDayRecord(AppDTO appDTO) { 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; return currentDayRecords;
} }
} }

+ 4
- 0
zs-manager/src/main/resources/mapper/DkRecordMapper.xml 查看文件

<if test="userId != null and userId != ''"> <if test="userId != null and userId != ''">
AND sys_user_id = #{userId} AND sys_user_id = #{userId}
</if> </if>

<if test="currentDate != null ">
AND create_time = #{currentDate}
</if>
</where> </where>
</select> </select>



Loading…
取消
儲存