db类型变更,模糊查询处理

main
yangzhicheng 12 months ago
parent 1da8536a4b
commit d297362ba8
  1. 34
      src/main/java/org/energy/modules/leger/controller/ToolInventoryRecordController.java
  2. 6
      src/main/java/org/energy/modules/leger/entity/ToolInventoryRecord.java

@ -19,6 +19,7 @@ import com.alibaba.excel.EasyExcel;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.dayu.daf.core.log.annotation.ApiLog;
import com.dayu.daf.core.tool.constant.DafConstant;
import com.xkcoding.http.util.StringUtil;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -45,19 +46,9 @@ import java.util.ArrayList;
import java.util.List;
import lombok.SneakyThrows;
import org.apache.commons.codec.Charsets;
import org.energy.modules.leger.excel.EquipmentLedgerExcel;
import org.energy.modules.system.excel.UserExcel;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestParam;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.energy.modules.leger.entity.EquipmentLedger;
import org.energy.modules.leger.vo.EquipmentLedgerVO;
import com.dayu.daf.core.boot.ctrl.DafController;
import springfox.documentation.annotations.ApiIgnore;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
@ -95,7 +86,28 @@ public class ToolInventoryRecordController extends DafController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "分页", notes = "传入toolInventoryRecord")
public R<IPage<ToolInventoryRecord>> list(ToolInventoryRecord toolInventoryRecord, Query query) {
IPage<ToolInventoryRecord> pages = toolInventoryRecordService.page(Condition.getPage(query), Condition.getQueryWrapper(toolInventoryRecord));
QueryWrapper<ToolInventoryRecord> qw = new QueryWrapper<>();
qw.orderByAsc("tools_code_id");
if (StringUtil.isNotEmpty(toolInventoryRecord.getToolsCodeId())) {
qw.lambda().like(ToolInventoryRecord::getToolsCodeId, toolInventoryRecord.getToolsCodeId());
}
if (StringUtil.isNotEmpty(toolInventoryRecord.getToolName())) {
qw.lambda().like(ToolInventoryRecord::getToolName, toolInventoryRecord.getToolName());
}
if (StringUtil.isNotEmpty(toolInventoryRecord.getToolCategory())) {
qw.lambda().like(ToolInventoryRecord::getToolCategory, toolInventoryRecord.getToolCategory());
}
if (StringUtil.isNotEmpty(toolInventoryRecord.getToolStatus())) {
qw.lambda().like(ToolInventoryRecord::getToolStatus, toolInventoryRecord.getToolStatus());
}
if (null != toolInventoryRecord.getIsInspectionPeriod()) {
qw.lambda().eq(ToolInventoryRecord::getIsInspectionPeriod, toolInventoryRecord.getIsInspectionPeriod());
}
if (null != toolInventoryRecord.getStations()) {
qw.lambda().eq(ToolInventoryRecord::getStations, toolInventoryRecord.getStations());
}
IPage<ToolInventoryRecord> pages = toolInventoryRecordService.page(Condition.getPage(query), qw);
return R.data(pages);
}

@ -31,7 +31,7 @@ public class ToolInventoryRecord extends BaseEntity {
* 工器具编码
*/
@ApiModelProperty(value = "工器具编码")
private Long toolsCodeId;
private String toolsCodeId;
/**
* 工器具名称
*/
@ -56,7 +56,7 @@ public class ToolInventoryRecord extends BaseEntity {
* 场站
*/
@ApiModelProperty(value = "场站")
private String stations;
private Integer stations;
/**
* 工器具类别
*/
@ -96,7 +96,7 @@ public class ToolInventoryRecord extends BaseEntity {
* 是否检验周期内
*/
@ApiModelProperty(value = "是否检验周期内")
private String isInspectionPeriod;
private Integer isInspectionPeriod;
/**
* 审核状态
*/

Loading…
Cancel
Save