perf: 查询日志增加参数

dev
huangfeng 1 year ago
parent b972b264ad
commit 8a31c7c9fb

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

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

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

Loading…
Cancel
Save