| | |
| | | package com.vci.ubcs.code.controller; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.vci.ubcs.code.entity.CodeReferConfig; |
| | | import com.vci.ubcs.code.service.CodeReferConfigService; |
| | | import com.vci.ubcs.code.vo.CodeReferConfigVO; |
| | | import com.vci.ubcs.starter.web.pagemodel.BaseQueryObject; |
| | | import com.vci.ubcs.starter.web.pagemodel.BladeQueryObject; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springframework.data.domain.Page; |
| | | import org.springframework.data.domain.PageRequest; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | @RestController |
| | | @RequestMapping("codeReferConfig") |
| | | public class CodeReferConfigController { |
| | | |
| | | /** |
| | | * 服务对象 |
| | | */ |
| | | @Resource |
| | | private CodeReferConfigService plCodeReferconfigService; |
| | | private CodeReferConfigService codeReferconfigService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * |
| | | * @param codeReferConfig 筛选条件 |
| | | * @param pageRequest 分页对象 |
| | | * @param bladeQueryObject 筛选条件 |
| | | * @return 查询结果 |
| | | */ |
| | | @GetMapping |
| | | public ResponseEntity<Page<CodeReferConfig>> queryByPage(CodeReferConfig codeReferConfig, PageRequest pageRequest) { |
| | | return ResponseEntity.ok(this.plCodeReferconfigService.queryByPage(codeReferConfig, pageRequest)); |
| | | @GetMapping("getReferConfigPage") |
| | | public R<IPage<CodeReferConfigVO>> queryByPage(BladeQueryObject bladeQueryObject) { |
| | | return R.data(this.codeReferconfigService.queryByPage(bladeQueryObject)); |
| | | } |
| | | |
| | | /** |
| | | * 通过主键查询单条数据 |
| | | * |
| | | * @param id 主键 |
| | | * @param oid 主键 |
| | | * @return 单条数据 |
| | | */ |
| | | @GetMapping("{id}") |
| | | public ResponseEntity<CodeReferConfig> queryById(@PathVariable("id") String id) { |
| | | return ResponseEntity.ok(this.plCodeReferconfigService.queryById(id)); |
| | | @GetMapping("getByOid") |
| | | public R<CodeReferConfig> queryById(@RequestParam("oid") String oid) { |
| | | return R.data(this.codeReferconfigService.queryById(oid)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param codeReferConfig 实体 |
| | | * @return 新增结果 |
| | | */ |
| | | @PostMapping |
| | | public ResponseEntity<CodeReferConfig> add(CodeReferConfig codeReferConfig) { |
| | | return ResponseEntity.ok(this.plCodeReferconfigService.insert(codeReferConfig)); |
| | | @PostMapping("/save") |
| | | public R<CodeReferConfig> add(CodeReferConfig codeReferConfig) { |
| | | return R.data(this.codeReferconfigService.insert(codeReferConfig)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param codeReferConfig 实体 |
| | | * @return 编辑结果 |
| | | */ |
| | | @PutMapping |
| | | public ResponseEntity<CodeReferConfig> edit(CodeReferConfig codeReferConfig) { |
| | | return ResponseEntity.ok(this.plCodeReferconfigService.update(codeReferConfig)); |
| | | @PutMapping("/edit") |
| | | public R<CodeReferConfig> edit(CodeReferConfig codeReferConfig) { |
| | | return R.data(this.codeReferconfigService.update(codeReferConfig)); |
| | | } |
| | | |
| | | /** |
| | |
| | | * @param id 主键 |
| | | * @return 删除是否成功 |
| | | */ |
| | | @DeleteMapping |
| | | public ResponseEntity<Boolean> deleteById(String id) { |
| | | return ResponseEntity.ok(this.plCodeReferconfigService.deleteById(id)); |
| | | @DeleteMapping("/del") |
| | | public R<Boolean> deleteById(String id) { |
| | | return R.data(this.codeReferconfigService.deleteById(id)); |
| | | } |
| | | |
| | | } |