You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

106 lines
3.4 KiB

package com.ruoyi.programManagement.controller;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.programManagement.entity.BPlanEnterprise;
import com.ruoyi.programManagement.service.BPlanEnterpriseService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.transaction.annotation.Transactional;
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.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.io.Serializable;
import java.util.List;
/**
* (BPlanEnterprise)
*
* @author wu
* @since 2023-09-07 09:43:06
*/
@RestController
@RequestMapping("pharmaceuticals/bPlanEnterprise")
@Api(tags = "计划企业表")
@Transactional(rollbackFor = Exception.class)
public class BPlanEnterpriseController extends BaseController {
/**
*
*/
@Resource
private BPlanEnterpriseService bPlanEnterpriseService;
/**
*
*
* @param page
* @param bPlanEnterprise
* @return
*/
@GetMapping
@ApiOperation(value = "分页条件查询计划企业表", response = BPlanEnterprise.class)
public AjaxResult page(Page<BPlanEnterprise> page, BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.page(page, new QueryWrapper<>(bPlanEnterprise)));
}
/**
*
*
* @param id
* @return
*/
@GetMapping("{id}")
@ApiOperation(value = "通过主键查询单条计划企业表", response = BPlanEnterprise.class)
public AjaxResult getById(@PathVariable Serializable id) {
return success(bPlanEnterpriseService.getById(id));
}
/**
*
*
* @param bPlanEnterprise
* @return
*/
@PostMapping
@ApiOperation(value = "新增计划企业表", response = BPlanEnterprise.class)
public AjaxResult insert(@RequestBody BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.save(bPlanEnterprise));
}
/**
*
*
* @param bPlanEnterprise
* @return
*/
@PutMapping
@ApiOperation(value = "修改计划企业表")
public AjaxResult update(@RequestBody BPlanEnterprise bPlanEnterprise) {
return success(bPlanEnterpriseService.updateById(bPlanEnterprise));
}
/**
*
*
* @param idList
* @return
*/
@DeleteMapping
@ApiOperation(value = "删除计划企业表")
public AjaxResult delete(@RequestParam("idList") List<Long> idList) {
return success(bPlanEnterpriseService.removeByIds(idList));
}
}