From 2d2fd991826837d7189cc488aee6f309a6f5e216 Mon Sep 17 00:00:00 2001
From: Junjie <fallin.jie@qq.com>
Date: 星期一, 09 三月 2026 22:48:46 +0800
Subject: [PATCH] #
---
src/main/java/com/zy/asrs/controller/BasCrnpErrLogController.java | 39 ++++++++++++++++++++-------------------
1 files changed, 20 insertions(+), 19 deletions(-)
diff --git a/src/main/java/com/zy/asrs/controller/BasCrnpErrLogController.java b/src/main/java/com/zy/asrs/controller/BasCrnpErrLogController.java
index 24349d3..ed3186c 100644
--- a/src/main/java/com/zy/asrs/controller/BasCrnpErrLogController.java
+++ b/src/main/java/com/zy/asrs/controller/BasCrnpErrLogController.java
@@ -2,9 +2,9 @@
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
-import com.baomidou.mybatisplus.mapper.EntityWrapper;
-import com.baomidou.mybatisplus.mapper.Wrapper;
-import com.baomidou.mybatisplus.plugins.Page;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.core.common.DateUtils;
import com.zy.asrs.entity.BasCrnpErrLog;
import com.zy.asrs.service.BasCrnpErrLogService;
@@ -27,7 +27,7 @@
@RequestMapping(value = "/basCrnpErrLog/{id}/auth")
@ManagerAuth
public R get(@PathVariable("id") String id) {
- return R.ok(basCrnpErrLogService.selectById(String.valueOf(id)));
+ return R.ok(basCrnpErrLogService.getById(String.valueOf(id)));
}
@RequestMapping(value = "/basCrnpErrLog/list/auth")
@@ -38,23 +38,24 @@
@RequestParam(required = false)String orderByType,
@RequestParam(required = false)String condition,
@RequestParam Map<String, Object> param){
- EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>();
+ QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>();
excludeTrash(param);
convert(param, wrapper);
allLike(BasCrnpErrLog.class, param.keySet(), wrapper, condition);
- if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));}
- return R.ok(basCrnpErrLogService.selectPage(new Page<>(curr, limit), wrapper));
+ if (!Cools.isEmpty(orderByField)){wrapper.orderBy(true, "asc".equals(orderByType), humpToLine(orderByField));}
+ return R.ok(basCrnpErrLogService.page(new Page<>(curr, limit), wrapper));
}
- private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){
+ private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){
for (Map.Entry<String, Object> entry : map.entrySet()){
String val = String.valueOf(entry.getValue());
+ String column = humpToLine(entry.getKey());
if (val.contains(RANGE_TIME_LINK)){
String[] dates = val.split(RANGE_TIME_LINK);
- wrapper.ge(entry.getKey(), DateUtils.convert(dates[0]));
- wrapper.le(entry.getKey(), DateUtils.convert(dates[1]));
+ wrapper.ge(column, DateUtils.convert(dates[0]));
+ wrapper.le(column, DateUtils.convert(dates[1]));
} else {
- wrapper.like(entry.getKey(), val);
+ wrapper.like(column, val);
}
}
}
@@ -62,7 +63,7 @@
@RequestMapping(value = "/basCrnpErrLog/add/auth")
@ManagerAuth
public R add(BasCrnpErrLog basCrnpErrLog) {
- basCrnpErrLogService.insert(basCrnpErrLog);
+ basCrnpErrLogService.save(basCrnpErrLog);
return R.ok();
}
@@ -80,7 +81,7 @@
@ManagerAuth
public R delete(@RequestParam(value="ids[]") Integer[] ids){
for (Integer id : ids){
- basCrnpErrLogService.deleteById(id);
+ basCrnpErrLogService.removeById(id);
}
return R.ok();
}
@@ -88,20 +89,20 @@
@RequestMapping(value = "/basCrnpErrLog/export/auth")
@ManagerAuth
public R export(@RequestBody JSONObject param){
- EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>();
+ QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>();
List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class);
Map<String, Object> map = excludeTrash(param.getJSONObject("basCrnpErrLog"));
convert(map, wrapper);
- List<BasCrnpErrLog> list = basCrnpErrLogService.selectList(wrapper);
+ List<BasCrnpErrLog> list = basCrnpErrLogService.list(wrapper);
return R.ok(exportSupport(list, fields));
}
@RequestMapping(value = "/basCrnpErrLogQuery/auth")
@ManagerAuth
public R query(String condition) {
- EntityWrapper<BasCrnpErrLog> wrapper = new EntityWrapper<>();
+ QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<>();
wrapper.like("id", condition);
- Page<BasCrnpErrLog> page = basCrnpErrLogService.selectPage(new Page<>(0, 10), wrapper);
+ Page<BasCrnpErrLog> page = basCrnpErrLogService.page(new Page<>(0, 10), wrapper);
List<Map<String, Object>> result = new ArrayList<>();
for (BasCrnpErrLog basCrnpErrLog : page.getRecords()){
Map<String, Object> map = new HashMap<>();
@@ -115,8 +116,8 @@
@RequestMapping(value = "/basCrnpErrLog/check/column/auth")
@ManagerAuth
public R query(@RequestBody JSONObject param) {
- Wrapper<BasCrnpErrLog> wrapper = new EntityWrapper<BasCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
- if (null != basCrnpErrLogService.selectOne(wrapper)){
+ QueryWrapper<BasCrnpErrLog> wrapper = new QueryWrapper<BasCrnpErrLog>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val"));
+ if (null != basCrnpErrLogService.getOne(wrapper)){
return R.parse(BaseRes.REPEAT).add(getComment(BasCrnpErrLog.class, String.valueOf(param.get("key"))));
}
return R.ok();
--
Gitblit v1.9.1