package com.stylefeng.guns.modular.system.controller.general;
|
|
import com.stylefeng.guns.core.base.controller.BaseController;
|
import org.springframework.stereotype.Controller;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.ResponseBody;
|
import org.springframework.ui.Model;
|
import org.springframework.web.bind.annotation.PathVariable;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import com.stylefeng.guns.core.log.LogObjectHolder;
|
import org.springframework.web.bind.annotation.RequestParam;
|
import com.stylefeng.guns.modular.system.model.TBranchOffice;
|
import com.stylefeng.guns.modular.system.service.ITBranchOfficeService;
|
|
/**
|
* 控制器
|
*
|
* @author fengshuonan
|
* @Date 2023-02-21 11:17:18
|
*/
|
@Controller
|
@RequestMapping("/tBranchOffice")
|
public class TBranchOfficeController extends BaseController {
|
|
private String PREFIX = "/system/tBranchOffice/";
|
|
@Autowired
|
private ITBranchOfficeService tBranchOfficeService;
|
|
/**
|
* 跳转到首页
|
*/
|
@RequestMapping("")
|
public String index() {
|
return PREFIX + "tBranchOffice.html";
|
}
|
|
/**
|
* 跳转到添加
|
*/
|
@RequestMapping("/tBranchOffice_add")
|
public String tBranchOfficeAdd() {
|
return PREFIX + "tBranchOffice_add.html";
|
}
|
|
/**
|
* 跳转到修改
|
*/
|
@RequestMapping("/tBranchOffice_update/{tBranchOfficeId}")
|
public String tBranchOfficeUpdate(@PathVariable Integer tBranchOfficeId, Model model) {
|
TBranchOffice tBranchOffice = tBranchOfficeService.selectById(tBranchOfficeId);
|
model.addAttribute("item",tBranchOffice);
|
LogObjectHolder.me().set(tBranchOffice);
|
return PREFIX + "tBranchOffice_edit.html";
|
}
|
|
/**
|
* 获取列表
|
*/
|
@RequestMapping(value = "/list")
|
@ResponseBody
|
public Object list(String condition) {
|
return tBranchOfficeService.selectList(null);
|
}
|
|
/**
|
* 新增
|
*/
|
@RequestMapping(value = "/add")
|
@ResponseBody
|
public Object add(TBranchOffice tBranchOffice) {
|
tBranchOfficeService.insert(tBranchOffice);
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 删除
|
*/
|
@RequestMapping(value = "/delete")
|
@ResponseBody
|
public Object delete(@RequestParam Integer tBranchOfficeId) {
|
tBranchOfficeService.deleteById(tBranchOfficeId);
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 修改
|
*/
|
@RequestMapping(value = "/update")
|
@ResponseBody
|
public Object update(TBranchOffice tBranchOffice) {
|
tBranchOfficeService.updateById(tBranchOffice);
|
return SUCCESS_TIP;
|
}
|
|
/**
|
* 详情
|
*/
|
@RequestMapping(value = "/detail/{tBranchOfficeId}")
|
@ResponseBody
|
public Object detail(@PathVariable("tBranchOfficeId") Integer tBranchOfficeId) {
|
return tBranchOfficeService.selectById(tBranchOfficeId);
|
}
|
}
|