Commit 63ff58d5 by 邓实川 Committed by chenzg

查询购买记录接口优化

parent b88aeda6
...@@ -8,7 +8,6 @@ ...@@ -8,7 +8,6 @@
package cn.timer.api.controller.qyzx; package cn.timer.api.controller.qyzx;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -174,17 +173,18 @@ public class QyzxBusinessController { ...@@ -174,17 +173,18 @@ public class QyzxBusinessController {
} }
@GetMapping(value = "/queryBuyRecord") // TODO @GetMapping(value = "/queryBuyRecord")
@ApiOperation(value = "查询购买记录", httpMethod = "GET", notes = "接口发布说明") @ApiOperation(value = "查询购买记录", httpMethod = "GET", notes = "接口发布说明")
public Result<List<QyzxBuyRecord>> queryBuyRecord(@CurrentUser UserBean userBean, public Result<List<QyzxBuyRecord>> queryBuyRecord(@CurrentUser UserBean userBean,
@RequestParam(defaultValue = "1", required = false) Integer pageNum, @RequestParam(defaultValue = "1", required = false) Integer pageNum,
@RequestParam(defaultValue = "10", required = false) Integer pageSize, @RequestParam(defaultValue = "10", required = false) Integer pageSize,
@RequestParam(required = false) String query, @RequestParam(required = false) Date stime, @RequestParam(required = false) String query, @RequestParam(required = false) String s,
@RequestParam(required = false) Date etime) { @RequestParam(required = false) String e) {
QueryWrapper<QyzxBuyRecord> queryWrapper = new QueryWrapper<>(); QueryWrapper<QyzxBuyRecord> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("org_code", userBean.getOrgCode()).and(!StrUtil.hasBlank(query), queryWrapper.eq("org_code", userBean.getOrgCode()).and(!StrUtil.hasBlank(query),
wq -> wq.like("order_no", query).or().like("content", query)); wq -> wq.like("order_no", query).or().like("content", query));
queryWrapper.between(s != null || s != "" && e != null || e != "", "create_time",
!StrUtil.hasBlank(s) ? s : "1000-01-01 00:00:00", !StrUtil.hasBlank(e) ? e : "9999-01-01 00:00:00");
Page<Object> page = PageHelper.startPage(pageNum, pageSize); Page<Object> page = PageHelper.startPage(pageNum, pageSize);
List<QyzxBuyRecord> list = QyzxBuyRecord.builder().build().selectList(queryWrapper); List<QyzxBuyRecord> list = QyzxBuyRecord.builder().build().selectList(queryWrapper);
return ResultUtil.pageData(list, page.getTotal(), "查询成功"); return ResultUtil.pageData(list, page.getTotal(), "查询成功");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment