管道基础大数据平台系统开发-【后端】-Server
Surpriseplus
2022-09-23 58e3f4d84622151b80090f113b6cdd93b3a41e5e
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
package com.lf.server.controller.organization;
 
import com.lf.server.entity.Result;
import com.lf.server.entity.organization.DepEntity;
import com.lf.server.service.oraganization.DepService;
import io.netty.util.internal.StringUtil;
import org.apache.tomcat.util.buf.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
 
import java.util.List;
 
/**
 * 组织机构
 * @author sws
 * @date   2022-09-23
 */
 
@RestController
@RequestMapping("/dep")
public class DepController {
    @Autowired
    DepService depService;
 
    @RequestMapping(value ="/insertDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer insertDep(DepEntity depEntity){
 
        return depService.insertDep(depEntity);
    }
 
    @ResponseBody
    @RequestMapping(value ="/deleteDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteDep(int id){
        return depService.deleteDep(id);
    }
 
    @ResponseBody
    @RequestMapping(value ="/deleteDeps", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer deleteDeps(Integer[] ids){
        if(null == ids || ids.length ==0 ){
            return  -1;
        //}else{
        //    return depService.deleteDep(StringUtils.join(ids,","));
        }
 
        return 0;
    }
 
    @ResponseBody
    @RequestMapping(value ="/updateDep", method = RequestMethod.POST, produces = "application/json; charset=UTF-8")
    public Integer updateDep(DepEntity depEntity){
        return depService.updateDep(depEntity);
    }
 
    @GetMapping(value ="/selectDep")
    public DepEntity selectDep(DepEntity depEntity){
        return depService.selectDep(depEntity);
    }
 
    @GetMapping(value ="/selectDepAll")
    public List<DepEntity> selectDepAll( ){
        return depService.selectDepAll( );
    }
 
}