You've already forked FrameTour-BE
refactor(paging): 重构分页查询使用 PageHelper
-将 MyBatis-Plus 的分页插件替换为 PageHelper - 更新了相关控制器、服务接口和实现类中的分页查询方法 - 优化了分页查询的逻辑,提高了代码的可读性和维护性
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package com.ycwl.basic.pricing.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ycwl.basic.pricing.entity.PriceVoucherUsageRecord;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -121,16 +120,15 @@ public interface PriceVoucherUsageRecordMapper extends BaseMapper<PriceVoucherUs
|
||||
Date getLastUseTimeByFaceIdAndBatchId(@Param("faceId") Long faceId, @Param("batchId") Long batchId);
|
||||
|
||||
/**
|
||||
* 分页查询券码使用记录
|
||||
*
|
||||
* @param page 分页参数
|
||||
* 查询券码使用记录(用于PageHelper分页)
|
||||
*
|
||||
* @param batchId 批次ID(可选)
|
||||
* @param voucherCode 券码(可选)
|
||||
* @param faceId 用户faceId(可选)
|
||||
* @param scenicId 景区ID(可选)
|
||||
* @param startTime 开始时间(可选)
|
||||
* @param endTime 结束时间(可选)
|
||||
* @return 分页结果
|
||||
* @return 使用记录列表
|
||||
*/
|
||||
@Select("<script>" +
|
||||
"SELECT * FROM price_voucher_usage_record WHERE deleted = 0" +
|
||||
@@ -142,8 +140,7 @@ public interface PriceVoucherUsageRecordMapper extends BaseMapper<PriceVoucherUs
|
||||
"<if test=\"endTime != null\">AND use_time <= #{endTime}</if>" +
|
||||
"ORDER BY use_time DESC" +
|
||||
"</script>")
|
||||
Page<PriceVoucherUsageRecord> selectPageWithConditions(Page<PriceVoucherUsageRecord> page,
|
||||
@Param("batchId") Long batchId,
|
||||
List<PriceVoucherUsageRecord> selectListWithConditions(@Param("batchId") Long batchId,
|
||||
@Param("voucherCode") String voucherCode,
|
||||
@Param("faceId") Long faceId,
|
||||
@Param("scenicId") Long scenicId,
|
||||
|
||||
Reference in New Issue
Block a user