Commit 8a81a301 authored by KeYong's avatar KeYong

更新查询装备定义列表

parent 401f2d3e
...@@ -266,11 +266,10 @@ public class FaultCaseController extends AbstractBaseController { ...@@ -266,11 +266,10 @@ public class FaultCaseController extends AbstractBaseController {
* *
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY, needAuth = false)
@ApiOperation(httpMethod = "GET",value = "装备定义列表不分页", notes = "装备定义列表不分页") @ApiOperation(httpMethod = "GET",value = "装备定义列表不分页", notes = "装备定义列表不分页")
@GetMapping(value = "/equip/list") @GetMapping(value = "/equip/list")
public ResponseModel<List<EquiplistSpecificBySystemVO>> getEquipList(@RequestParam(value = "systemId") String systemId, public ResponseModel<List<EquiplistSpecificBySystemVO>> getEquipList(@RequestParam(value = "systemId", required = false) String systemId) {
@RequestParam(value = "systemCode") String systemCode) { return CommonResponseUtil.success(iEquipmentService.getAllByCode(systemId));
return CommonResponseUtil.success(iEquipmentService.getAllByCode(systemId, systemCode));
} }
} }
...@@ -127,5 +127,5 @@ public interface IEquipmentService extends IService<Equipment> { ...@@ -127,5 +127,5 @@ public interface IEquipmentService extends IService<Equipment> {
*/ */
EquipmentVo getEquipBySpecific(Long equipmentSpecificId); EquipmentVo getEquipBySpecific(Long equipmentSpecificId);
List<Equipment> getAllByCode(String id, String code); List<Equipment> getAllByCode(String id);
} }
package com.yeejoin.equipmanage.service.impl; package com.yeejoin.equipmanage.service.impl;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
...@@ -467,11 +468,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -467,11 +468,16 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
} }
@Override @Override
public List<Equipment> getAllByCode(String id, String code) { public List<Equipment> getAllByCode(String id) {
QueryWrapper<Equipment> queryWrapper = new QueryWrapper<Equipment>(); if (StringUtils.isNotEmpty(id)) {
queryWrapper.likeLeft("code", code); EquipmentCategory category = equipmentCategoryMapper.selectOne(new LambdaQueryWrapper<EquipmentCategory>().eq(EquipmentCategory::getId, Long.valueOf(id)));
queryWrapper.ne("id", Long.valueOf(id)); QueryWrapper<Equipment> queryWrapper = new QueryWrapper<Equipment>();
return equipmentMapper.selectList(queryWrapper); queryWrapper.likeRight("code", category.getCode().substring(0,4));
queryWrapper.ne("id", Long.valueOf(id));
return equipmentMapper.selectList(queryWrapper);
} else {
return this.list();
}
} }
@Override @Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment