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
84
85
package com.ruoyi.basic.controller;
 
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.basic.pojo.OilDepot;
import com.ruoyi.basic.service.IOilDepotService;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.framework.web.domain.R;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
/**
 * 油库信息Controller
 *
 * @author ruoyi
 * @date 2026-09-10
 */
@RestController
@RequestMapping("/basic/oilDepot")
@AllArgsConstructor
public class OilDepotController {
    private IOilDepotService oilDepotService;
 
    /**
     * 分页查询油库信息列表
     */
    @GetMapping("/list")
    public R list(Page<OilDepot> page, OilDepot oilDepot) {
        IPage<OilDepot> result = oilDepotService.selectOilDepotList(page, oilDepot);
        return R.ok(result);
    }
 
    /**
     * 查询全部油库信息(供下拉选择)
     */
    @GetMapping("/all")
    public R all() {
        return R.ok(oilDepotService.selectAll());
    }
 
    /**
     * 获取油库信息详细信息
     */
    @GetMapping(value = "/{id}")
    public R getInfo(@PathVariable("id") Long id) {
        return R.ok(oilDepotService.selectOilDepotById(id));
    }
 
    /**
     * 新增油库信息
     */
    @Log(title = "油库信息", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    public R add(@RequestBody OilDepot oilDepot) {
        return R.ok(oilDepotService.insertOilDepot(oilDepot));
    }
 
    /**
     * 修改油库信息
     */
    @Log(title = "油库信息", businessType = BusinessType.UPDATE)
    @PostMapping("/update")
    public R edit(@RequestBody OilDepot oilDepot) {
        return R.ok(oilDepotService.updateOilDepot(oilDepot));
    }
 
    /**
     * 删除油库信息
     */
    @Log(title = "油库信息", businessType = BusinessType.DELETE)
    @DeleteMapping("/del")
    public R remove(@RequestBody Long[] ids) {
        if (ids == null || ids.length == 0) {
            return R.fail("请传入要删除的ID");
        }
        return R.ok(oilDepotService.deleteOilDepotByIds(ids));
    }
}