perf: 查询日志增加参数

dev
huangfeng 1 year ago
parent b972b264ad
commit 8a31c7c9fb

@ -27,8 +27,8 @@ public class MntnUploadController extends BaseController {
@GetMapping("listAll")
@ApiOperation("查询全部列表")
public ResponseReult<List<MntnUploads>> listAll(Integer type) {
List<MntnUploads> result = service.listAll(type);
public ResponseReult<List<MntnUploads>> listAll(Integer type, String cmdid) {
List<MntnUploads> result = service.listAll(type, cmdid);
return ResponseReult.success(result);
}

@ -1,11 +1,12 @@
package com.shxy.xymanager_service.impl;
import com.shxy.xymanager_common.entity.*;
import com.shxy.xymanager_common.exception.ApiException;
import com.shxy.xymanager_common.util.DateUtil;
import com.shxy.xymanager_common.util.DigestUtils;
import com.shxy.xymanager_dao.dao.MntnUploadsMapper;
import com.shxy.xymanager_service.service.MntnUploadService;
import com.shxy.xymanager_service.service.NewCacheService;
import com.shxy.xymanager_service.service.TerminalExtService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -15,7 +16,6 @@ import org.springframework.web.multipart.MultipartFile;
import javax.annotation.Resource;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.List;
import java.util.UUID;
@ -33,11 +33,20 @@ public class MntnUploadServiceImpl implements MntnUploadService {
MntnUploadsMapper mapper;
@Resource
NewCacheService cacheService;
@Resource
TerminalExtService terminalExtService;
@Override
public List<MntnUploads> listAll(Integer type) {
public List<MntnUploads> listAll(Integer type, String cmdid) {
MntnUploadsExample example = new MntnUploadsExample();
MntnUploadsExample.Criteria criteria = example.createCriteria();
if (StringUtils.hasLength(cmdid)) {
Terminals t = terminalExtService.getByCmdid(cmdid);
if (t == null) {
throw new ApiException("该装置不存在");
}
criteria.andTermIdEqualTo(t.getId());
}
if (type != null) {
criteria.andTypeEqualTo(type);
}

@ -8,7 +8,7 @@ import java.util.List;
public interface MntnUploadService {
List<MntnUploads> listAll(Integer type);
List<MntnUploads> listAll(Integer type, String cmdid);
void delete(Integer id) throws Exception;

Loading…
Cancel
Save