zhanghua
2023-04-03 c8688c4239077b123165f3e86a380a41b40f39db
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
package com.ycl.controller.writ;
 
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ycl.annotation.LogSave;
import com.ycl.api.CommonResult;
import com.ycl.controller.BaseController;
import com.ycl.entity.writ.WritTemplate;
import com.ycl.service.writ.IWritTemplateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * <p>
 * 文书模板表 前端控制器
 * </p>
 *
 * @author lyq
 * @since 2022-11-14
 */
@RestController
@RequestMapping("/writ_template")
@Api(tags = "文书模板管理")
public class WritTemplateController extends BaseController {
 
    @Autowired
    IWritTemplateService iWritTemplateService;
 
    @GetMapping("/query")
    @ApiOperation(value = "查询")
    @LogSave(operationType = "文书模板管理", contain = "查询文书模板")
    public CommonResult search(@RequestParam Integer pageSize,
                               @RequestParam Integer currentPage,
                               @RequestParam(required = false) String name) {
        return CommonResult.success(iWritTemplateService.page(new Page<>(currentPage, pageSize), new LambdaQueryWrapper<WritTemplate>()
                .like(StringUtils.isNotBlank(name), WritTemplate::getName, name)));
    }
}