Commit 3136ad3e authored by 竹天卫's avatar 竹天卫

选择设备接口 加上设备名称筛选

parent 9ccf9f5a
...@@ -398,9 +398,9 @@ public class EquipmentController { ...@@ -398,9 +398,9 @@ public class EquipmentController {
@ApiOperation(value = "分类选择设备列表") @ApiOperation(value = "分类选择设备列表")
@GetMapping("/getEquipmentList") @GetMapping("/getEquipmentList")
public BaseResponse getEquipmentList() { public BaseResponse getEquipmentList(String name) {
try { try {
return equipmentService.getEquipmentList(); return equipmentService.getEquipmentList(name);
} catch (Exception e) { } catch (Exception e) {
log.debug("分类选择设备列表{}", e); log.debug("分类选择设备列表{}", e);
} }
......
...@@ -23,7 +23,7 @@ public interface EquipmentMapper extends BaseMapper<Equipment> { ...@@ -23,7 +23,7 @@ public interface EquipmentMapper extends BaseMapper<Equipment> {
IPage<EquipmentVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params); IPage<EquipmentVo> getPage(@Param("page") Page page, @Param("params") Map<String, Object> params);
List<EquipmentVo> getEQList(); List<EquipmentVo> getEQList(String name);
List<Map<String, Object>> exportList(@Param("params") Map<String, Object> params); List<Map<String, Object>> exportList(@Param("params") Map<String, Object> params);
......
...@@ -36,6 +36,9 @@ ...@@ -36,6 +36,9 @@
left join supplier s on s.id = t.supplier_id left join supplier s on s.id = t.supplier_id
left join equipment_type et on et.id = t.type left join equipment_type et on et.id = t.type
where t.status = 1 where t.status = 1
<if test="name != null and name != ''">
and t.name like concat('%', #{name}, '%')
</if>
ORDER BY t.id DESC ORDER BY t.id DESC
</select> </select>
......
...@@ -18,6 +18,10 @@ ...@@ -18,6 +18,10 @@
) as members ) as members
from equipment_type et from equipment_type et
where et.status = 1 where et.status = 1
</select> </select>
......
...@@ -80,10 +80,8 @@ public interface IEquipmentService extends IService<Equipment> { ...@@ -80,10 +80,8 @@ public interface IEquipmentService extends IService<Equipment> {
BaseResponse<List<EquipmentType>> getTypeList(); BaseResponse<List<EquipmentType>> getTypeList();
BaseResponse<List<EquipmentTypeVo>> getEquipmentList(); BaseResponse<List<EquipmentTypeVo>> getEquipmentList(String name);
BaseResponse<String> changeType(Integer id, Integer typeId); BaseResponse<String> changeType(Integer id, Integer typeId);
} }
...@@ -896,9 +896,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment ...@@ -896,9 +896,9 @@ public class EquipmentServiceImpl extends ServiceImpl<EquipmentMapper, Equipment
* @return * @return
*/ */
@Override @Override
public BaseResponse<List<EquipmentTypeVo>> getEquipmentList() { public BaseResponse<List<EquipmentTypeVo>> getEquipmentList(String name) {
List<EquipmentTypeVo> listType = equipmentTypeMapper.getEqTypeList(); List<EquipmentTypeVo> listType = equipmentTypeMapper.getEqTypeList();
List<EquipmentVo> listEQ = equipmentMapper.getEQList(); List<EquipmentVo> listEQ = equipmentMapper.getEQList(name);
if(listType != null && listType.size()>0){ if(listType != null && listType.size()>0){
for(EquipmentTypeVo listTypevo : listType){ for(EquipmentTypeVo listTypevo : listType){
List<EquipmentVo> listVo = new ArrayList<>(); List<EquipmentVo> listVo = new ArrayList<>();
......
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