package cn.com.goldenwater.dcproj.controller.anze; import cn.com.goldenwater.core.web.BaseController; import cn.com.goldenwater.core.web.BaseResponse; import cn.com.goldenwater.dcproj.model.AttProjectInsuranceParticip; import cn.com.goldenwater.dcproj.param.AttProjectInsuranceParticipParam; import cn.com.goldenwater.dcproj.service.AttProjectInsuranceParticipService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.util.Assert; import org.springframework.web.bind.annotation.*; /** * @author lql * @date 2026-4-21 */ @Slf4j @Api(value = "水利工程参建单位信息管理", tags = "水利工程参建单位信息管理") @RestController @RequestMapping("/att/project/insurance/particip") public class AttProjectInsuranceParticipController extends BaseController { @Autowired private AttProjectInsuranceParticipService attProjectInsuranceParticipService; @ApiOperation(value = "添加水利工程参建单位信息") @RequestMapping(value = "/add", method = RequestMethod.POST) public BaseResponse insert( @ApiParam(name = "attProjectInsuranceParticip", value = "AttProjectInsuranceParticip", required = true) @RequestBody AttProjectInsuranceParticip attProjectInsuranceParticip) { int ret = attProjectInsuranceParticipService.insert(attProjectInsuranceParticip); return buildSuccessResponse(attProjectInsuranceParticip); } @ApiOperation(value = "根据ID删除水利工程参建单位信息") @RequestMapping(value = "delete/{id}", method = RequestMethod.POST) public BaseResponse delete(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { int ret = attProjectInsuranceParticipService.delete(id); return buildSuccessResponse(); } @ApiOperation(value = "更新水利工程参建单位信息信息") @RequestMapping(value = "/update", method = RequestMethod.POST) public BaseResponse update(@ApiParam(name = "attProjectInsuranceParticip", value = "AttProjectInsuranceParticip", required = true) @RequestBody AttProjectInsuranceParticip attProjectInsuranceParticip) { Assert.notNull(attProjectInsuranceParticip.getId(), "主键id为必填参数"); int ret = attProjectInsuranceParticipService.update(attProjectInsuranceParticip); return buildSuccessResponse(attProjectInsuranceParticip); } @ApiOperation(value = "根据ID获取水利工程参建单位信息(单表)") @RequestMapping(value = "/{id}", method = RequestMethod.GET) public BaseResponse get(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttProjectInsuranceParticip attProjectInsuranceParticip = attProjectInsuranceParticipService.get(id); return buildSuccessResponse(attProjectInsuranceParticip); } @ApiOperation(value = "根据ID获取水利工程参建单位信息(单表)") @RequestMapping(value = "/getByProjectId/{id}", method = RequestMethod.GET) public BaseResponse getByProjectId(@ApiParam(name = "id", value = "id", required = true) @PathVariable String id) { AttProjectInsuranceParticipParam param = new AttProjectInsuranceParticipParam(); param.setProjectId(id); AttProjectInsuranceParticip attProjectInsuranceParticip = attProjectInsuranceParticipService.getBy(param); return buildSuccessResponse(attProjectInsuranceParticip); } }