package com.vci.ubcs.code.controller;
|
|
import com.vci.ubcs.code.entity.CodeSrchCondConfig;
|
import com.vci.ubcs.code.service.CodeSrchCondConfigService;
|
import org.springframework.data.domain.Page;
|
import org.springframework.data.domain.PageRequest;
|
import org.springframework.http.ResponseEntity;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.annotation.Resource;
|
|
/**
|
* 引用码段,参照配置界面,查询条件配置表(CodeSrchCondConfig)表控制层
|
*
|
* @author ludc
|
* @since 2023-05-19 17:58:56
|
*/
|
@RestController
|
@RequestMapping("codeSrchCondConfig")
|
public class CodeSrchCondConfigController {
|
/**
|
* 服务对象
|
*/
|
@Resource
|
private CodeSrchCondConfigService codeSrchCondConfigService;
|
|
/**
|
* 分页查询
|
*
|
* @param plCodeSrchcondconfig 筛选条件
|
* @param pageRequest 分页对象
|
* @return 查询结果
|
*/
|
@GetMapping
|
public ResponseEntity<Page<CodeSrchCondConfig>> queryByPage(CodeSrchCondConfig plCodeSrchcondconfig, PageRequest pageRequest) {
|
return ResponseEntity.ok(this.codeSrchCondConfigService.queryByPage(plCodeSrchcondconfig, pageRequest));
|
}
|
|
/**
|
* 通过主键查询单条数据
|
*
|
* @param id 主键
|
* @return 单条数据
|
*/
|
@GetMapping("{id}")
|
public ResponseEntity<CodeSrchCondConfig> queryById(@PathVariable("id") String id) {
|
return ResponseEntity.ok(this.codeSrchCondConfigService.queryById(id));
|
}
|
|
/**
|
* 新增数据
|
*
|
* @param plCodeSrchcondconfig 实体
|
* @return 新增结果
|
*/
|
@PostMapping
|
public ResponseEntity<CodeSrchCondConfig> add(CodeSrchCondConfig plCodeSrchcondconfig) {
|
return ResponseEntity.ok(this.codeSrchCondConfigService.insert(plCodeSrchcondconfig));
|
}
|
|
/**
|
* 编辑数据
|
*
|
* @param plCodeSrchcondconfig 实体
|
* @return 编辑结果
|
*/
|
@PutMapping
|
public ResponseEntity<CodeSrchCondConfig> edit(CodeSrchCondConfig plCodeSrchcondconfig) {
|
return ResponseEntity.ok(this.codeSrchCondConfigService.update(plCodeSrchcondconfig));
|
}
|
|
/**
|
* 删除数据
|
*
|
* @param id 主键
|
* @return 删除是否成功
|
*/
|
@DeleteMapping
|
public ResponseEntity<Boolean> deleteById(String id) {
|
return ResponseEntity.ok(this.codeSrchCondConfigService.deleteById(id));
|
}
|
|
}
|