12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788 |
- package com.gyee.backconfig.controller;
- import com.baomidou.mybatisplus.core.metadata.IPage;
- import com.gyee.backconfig.config.R;
- import com.gyee.backconfig.model.auto.ProEconEquipmentmodel;
- import com.gyee.backconfig.service.auto.IProEconEquipmentmodelService;
- import io.swagger.annotations.Api;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.web.bind.annotation.*;
- import javax.annotation.Resource;
- import java.util.Arrays;
- /**
- * <p>
- * 设备型号 前端控制器
- * </p>
- *
- * @author wang
- * @since 2022-10-15
- */
- @RestController
- @RequestMapping("//pro-econ-equipmentmodel")
- @Api(value = "设备型号配置" ,tags = "设备型号配置")
- public class ProEconEquipmentmodelController {
- @Resource
- private IProEconEquipmentmodelService proEconEquipmentmodelService;
- /**
- * 查询
- * @param id
- * @param nemCode
- * @param name
- * @param pageNum
- * @param pageSize
- * @return
- */
- @GetMapping(value = "/list")
- @ApiOperation(value = "设备型号-列表", notes = "设备型号-列表")
- public R findList(@RequestParam(value = "id", required = false) String id,
- @RequestParam(value = "nemCode", required = false) String nemCode,
- @RequestParam(value = "name", required = false) String name,
- @RequestParam(value = "pageNum", required = true) String pageNum,
- @RequestParam(value = "pageSize", required = true) String pageSize) {
- IPage<ProEconEquipmentmodel> list = proEconEquipmentmodelService.list(id, nemCode, name, pageNum, pageSize);
- if (null != list) {
- return R.ok().data(list);
- } else {
- return R.error().data("查询失败!");
- }
- }
- /**
- * 添加
- * @param proEconEquipmentmodel
- * @return
- */
- @PostMapping(value = "/add")
- @ApiOperation(value = "设备型号-新增or修改", notes = "设备型号-新增or修改")
- public R addAll(@RequestBody ProEconEquipmentmodel proEconEquipmentmodel) {
- boolean b = proEconEquipmentmodelService.saveOrUpdate(proEconEquipmentmodel);
- if (b) {
- return R.ok().data(b);
- } else {
- return R.error().data("保存失败!");
- }
- }
- /**
- * 删除
- * @param ids
- * @return
- */
- @DeleteMapping(value = "/{ids}")
- @ApiOperation(value = "设备型号-新增or修改", notes = "设备型号-新增or修改")
- public R deleteAll(@PathVariable("ids") String ids) {
- String[] strings = ids.split(",");
- boolean b = proEconEquipmentmodelService.removeByIds(Arrays.asList(strings));
- if (b) {
- return R.ok().data(b);
- } else {
- return R.error().data("删除失败!");
- }
- }
- }
|