新增按照套餐ID 查询套餐体检项目 按照套餐项目ID删除套餐里的检查项目方法
This commit is contained in:
parent
72d19631d7
commit
638a12176c
@ -1,5 +1,6 @@
|
||||
package cn.iocoder.yudao.module.inspect.controller.admin.exammodule;
|
||||
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspectitems.InspectitemsDO;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -50,7 +51,13 @@ public class ExammoduleController {
|
||||
{
|
||||
return success(exammoduleService.ListcreateExammodule(createReqVO));
|
||||
}
|
||||
|
||||
@PostMapping("/getModuleIDtems")
|
||||
@Operation(summary = "根据套餐ID查询套餐下的检查项目")
|
||||
public CommonResult<List<InspectitemsDO>> getModuleIDInspectitems(@RequestParam("examModuleID") Integer ModuleID)
|
||||
{
|
||||
List<InspectitemsDO> doList= exammoduleService.selectItemsByExamModuleID(ModuleID);
|
||||
return success(doList);
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新体检套餐")
|
||||
@ -73,6 +80,13 @@ public class ExammoduleController {
|
||||
exammoduleService.deleteExammoduleModuleID(ModuleID);
|
||||
return success(true);
|
||||
}
|
||||
@DeleteMapping("/deleteitemcode")
|
||||
@Operation(summary = "按照套餐项目ID删除体检套餐项目")
|
||||
public CommonResult<Boolean> deleteExammoduleitemcode(@RequestParam("itemCode") Integer itemCode)
|
||||
{
|
||||
exammoduleService.deleteExammoduleitemcode(itemCode);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得体检套餐")
|
||||
|
@ -6,9 +6,12 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.exammodule.ExammoduleDO;
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspectitems.InspectitemsDO;
|
||||
import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.inspect.controller.admin.exammodule.vo.*;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
/**
|
||||
* 体检套餐 Mapper
|
||||
@ -26,5 +29,7 @@ public interface ExammoduleMapper extends BaseMapperX<ExammoduleDO> {
|
||||
.eqIfPresent(ExammoduleDO::getItemCode, reqVO.getItemCode())
|
||||
.orderByDesc(ExammoduleDO::getId));
|
||||
}
|
||||
|
||||
// 使用 @Select 注解直接写 SQL
|
||||
@Select("SELECT i.* FROM tb_items i LEFT JOIN tb_exammodule e ON e.itemCode = i.itemCode WHERE e.examModuleID = #{examModuleID}")
|
||||
List<InspectitemsDO> selectItemsByExamModuleID(@Param("examModuleID") Integer examModuleID);
|
||||
}
|
@ -5,6 +5,7 @@ import cn.iocoder.yudao.module.inspect.controller.admin.exammodule.vo.*;
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.exammodule.ExammoduleDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import cn.iocoder.yudao.module.inspect.dal.dataobject.inspectitems.InspectitemsDO;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
@ -26,6 +27,10 @@ public interface ExammoduleService {
|
||||
* 创建体检套餐 加项目
|
||||
* **/
|
||||
Boolean ListcreateExammodule(List<ExammoduleSaveReqVO> createReqVO);
|
||||
/*
|
||||
* 根据套餐ID 查询套餐下面的检查项目
|
||||
* */
|
||||
List<InspectitemsDO> selectItemsByExamModuleID(Integer examModuleID);
|
||||
|
||||
/**
|
||||
* 更新体检套餐
|
||||
@ -44,6 +49,10 @@ public interface ExammoduleService {
|
||||
* 按照体检套餐ID删除数据
|
||||
* */
|
||||
void deleteExammoduleModuleID(Integer moduleid);
|
||||
/*
|
||||
* 按照体检套餐里项目ID删除数据
|
||||
* */
|
||||
void deleteExammoduleitemcode(Integer itemcode);
|
||||
|
||||
/**
|
||||
* 获得体检套餐
|
||||
|
@ -53,7 +53,12 @@ public class ExammoduleServiceImpl implements ExammoduleService {
|
||||
List<ExammoduleDO> exammodule = BeanUtils.toBean(createReqVO, ExammoduleDO.class);
|
||||
return exammoduleMapper.insertBatch(exammodule);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InspectitemsDO> selectItemsByExamModuleID(Integer examModuleID)
|
||||
{
|
||||
List<InspectitemsDO> doList= exammoduleMapper.selectItemsByExamModuleID(examModuleID);
|
||||
return doList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateExammodule(ExammoduleSaveReqVO updateReqVO) {
|
||||
@ -78,7 +83,13 @@ public class ExammoduleServiceImpl implements ExammoduleService {
|
||||
queryWrapper.eq("examModuleID", moduleid);
|
||||
exammoduleMapper.delete(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteExammoduleitemcode(Integer itemcode)
|
||||
{
|
||||
QueryWrapper<ExammoduleDO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("itemCode", itemcode);
|
||||
exammoduleMapper.delete(queryWrapper);
|
||||
}
|
||||
private void validateExammoduleExists(Integer id) {
|
||||
if (exammoduleMapper.selectById(id) == null) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user