From 8f71e98681055f8f1b7f1b537dfe8f7b09aecf3d Mon Sep 17 00:00:00 2001 From: mashuai Date: Wed, 15 May 2024 15:58:46 +0800 Subject: [PATCH] bug --- .../ScrapApplyDetailsController.java | 6 ++-- .../material/domain/ScrapApplyDetails.java | 18 ++++++++++- .../material/ScrapApplyDetailsMapper.xml | 30 +++++++++++-------- 3 files changed, 39 insertions(+), 15 deletions(-) diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java index 96191d17..6e4edd4d 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/controller/ScrapApplyDetailsController.java @@ -13,6 +13,7 @@ import com.bonus.sgzb.material.service.IScrapApplyDetailsService; import com.bonus.sgzb.material.vo.ForecastWasteExcel; import com.bonus.sgzb.material.vo.ScrapApplyDetailsVO; import com.bonus.sgzb.material.vo.ScrapAudit; +import com.github.pagehelper.PageHelper; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; @@ -131,8 +132,7 @@ public class ScrapApplyDetailsController extends BaseController { */ @ApiOperation("查询预报废任务列表") @PostMapping("/getScrapApplyList") - public TableDataInfo getScrapApplyList(ScrapApplyDetails scrapApplyDetails) { - startPage(); + public TableDataInfo getScrapApplyList(@RequestBody ScrapApplyDetails scrapApplyDetails) { Map params = scrapApplyDetails.getParams(); if (!params.isEmpty()) { String beginTime = (String) params.get("beginTime"); @@ -141,6 +141,8 @@ public class ScrapApplyDetailsController extends BaseController { params.put("endTime", endTime + " 23:59:59"); scrapApplyDetails.setParams(params); } + //startPage(); + PageHelper.startPage(scrapApplyDetails.getPageNum() == 0 ? 1 : scrapApplyDetails.getPageNum(), scrapApplyDetails.getPageSize()); List list = scrapApplyDetailsService.getScrapApplyList(scrapApplyDetails); return getDataTable(list); } diff --git a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java index 82039d12..638559bc 100644 --- a/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java +++ b/sgzb-modules/sgzb-material/src/main/java/com/bonus/sgzb/material/domain/ScrapApplyDetails.java @@ -118,7 +118,6 @@ public class ScrapApplyDetails extends BaseEntity @ApiModelProperty(value = "数据状态") private Integer repairStatus; - private String keywords; private String keyword; private String typeName; @@ -132,6 +131,23 @@ public class ScrapApplyDetails extends BaseEntity @ApiModelProperty(value = "结束时间") private String endTime; + /** 当前记录起始索引 */ + private Integer pageNum; + + /** 每页显示记录数 */ + private Integer pageSize; + + /** 导出选中列表 */ + private List dataCondition; + + public List getDataCondition() { + return dataCondition; + } + + public void setDataCondition(List dataCondition) { + this.dataCondition = dataCondition; + } + public void setId(Long id) { diff --git a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml index 11415bbd..a1ab61ba 100644 --- a/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml +++ b/sgzb-modules/sgzb-material/src/main/resources/mapper/material/ScrapApplyDetailsMapper.xml @@ -72,12 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE sad.scrap_source IN ( '1', '2' ) AND tk.task_type = 57 - - AND (locate(#{keywords}, tk.create_by) > 0 - or locate(#{keywords}, tk.CODE) > 0 - or locate(#{keywords}, bui.unit_name) > 0 - or locate(#{keywords}, bpl.lot_name) > 0 - or locate(#{keywords}, tk1.CODE) > 0) + + AND (locate(#{keyword}, tk.create_by) > 0 + or locate(#{keyword}, tk.CODE) > 0 + or locate(#{keyword}, bui.unit_name) > 0 + or locate(#{keyword}, bpl.lot_name) > 0 + or locate(#{keyword}, tk1.CODE) > 0) and bui.unit_id = #{backUnit} @@ -464,12 +464,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE sad.scrap_source IN ( '1', '2' ) AND tk.task_type IN ('20' , '21') - - AND (locate(#{keywords}, tk.create_by) > 0 - or locate(#{keywords}, tk.CODE) > 0 - or locate(#{keywords}, bui.unit_name) > 0 - or locate(#{keywords}, bpl.lot_name) > 0 - or locate(#{keywords}, tk1.CODE) > 0) + + AND (locate(#{keyword}, tk.create_by) > 0 + or locate(#{keyword}, tk.CODE) > 0 + or locate(#{keyword}, bui.unit_name) > 0 + or locate(#{keyword}, bpl.lot_name) > 0 + or locate(#{keyword}, tk1.CODE) > 0) and bui.unit_id = #{backUnit} @@ -495,6 +495,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and DATE(tk.create_time) between #{beginTime} and #{endTime} + + AND tk.task_id in + + #{taskId} + + GROUP BY tk.CODE order by tk.create_time desc