kongdeqiang
3 天以前 51ca84cb45d5d6a4d1a49aa29ea8479568b65f34
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
package com.boying.controller;
 
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.boying.common.R;
import com.boying.entity.Repair;
import com.boying.entity.WhiteList;
import com.boying.service.ParkService;
import com.boying.service.RepairService;
import com.boying.service.WhiteListService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
 
 
@RestController
@RequestMapping("ffzf/repair")
@RequiredArgsConstructor
public class RepairController {
 
    private final RepairService repairService;
    private final ParkService parkService;
 
    @PostMapping("/findPage")
    //@Operation(summary = "分页查询" , description = "分页查询" )
    public Object findPage(Page page, String carNo) {
        QueryWrapper<Repair> wrapper = new QueryWrapper<>();
        wrapper.lambda()
                .orderByDesc(Repair::getId);
        Page<Repair> page1 = repairService.page(page, wrapper);
        return R.ok(page1);
    }
 
 
    @PostMapping("/save")
    public Object save(Repair repair) {
        repairService.saveOrUpdate(repair);
        return R.ok("保存成功");
    }
 
    @PostMapping("/delete")
    public Object delete(Long id) {
        repairService.removeById(id);
        return R.ok("删除成功");
    }
}