ludc
2023-05-23 b8886034cbd7a43911d6b24e322f604f557c1e02
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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));
    }
 
}