From 347364ecd67809a677e2d4ed1d2b2cf5555824c0 Mon Sep 17 00:00:00 2001 From: piaobo <1913856125@qq.com> Date: Fri, 11 Jul 2025 16:40:46 +0800 Subject: [PATCH] =?UTF-8?q?=E8=8D=AF=E5=93=81=E4=BF=A1=E6=81=AF=20lombok?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=20=E4=BD=BF=E7=94=A8@Data=E6=B3=A8=E8=A7=A3?= =?UTF-8?q?=E7=9C=81=E7=95=A5getset=E6=96=B9=E6=B3=95=E4=B9=A6=E5=86=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pom.xml | 7 -- zhyc-module/pom.xml | 4 + .../controller/SwMedicTypeController.java | 105 ++++++++++++++++++ .../controller/SwMedicineController.java | 105 ++++++++++++++++++ .../controller/SwUsageController.java | 105 ++++++++++++++++++ .../module/biosafety/domain/SwMedicType.java | 52 +++++++++ .../module/biosafety/domain/SwMedicine.java | 45 ++++++++ .../zhyc/module/biosafety/domain/SwUsage.java | 37 ++++++ .../biosafety/mapper/SwMedicTypeMapper.java | 62 +++++++++++ .../biosafety/mapper/SwMedicineMapper.java | 61 ++++++++++ .../biosafety/mapper/SwUsageMapper.java | 61 ++++++++++ .../service/ISwMedicTypeService.java | 62 +++++++++++ .../biosafety/service/ISwMedicineService.java | 62 +++++++++++ .../biosafety/service/ISwUsageService.java | 61 ++++++++++ .../service/impl/SwMedicTypeServiceImpl.java | 94 ++++++++++++++++ .../service/impl/SwMedicineServiceImpl.java | 94 ++++++++++++++++ .../service/impl/SwUsageServiceImpl.java | 94 ++++++++++++++++ .../SwDiseaseMapper.xml | 0 .../mapper/biosafety/SwMedicTypeMapper.xml | 56 ++++++++++ .../mapper/biosafety/SwMedicineMapper.xml | 76 +++++++++++++ .../mapper/biosafety/SwUsageMapper.xml | 56 ++++++++++ 21 files changed, 1292 insertions(+), 7 deletions(-) create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java rename zhyc-module/src/main/resources/mapper/{disease => biosafety}/SwDiseaseMapper.xml (100%) create mode 100644 zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml create mode 100644 zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml create mode 100644 zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml diff --git a/pom.xml b/pom.xml index 90f91a3..46faae5 100644 --- a/pom.xml +++ b/pom.xml @@ -175,13 +175,6 @@ jjwt ${jwt.version} - - - org.springframework.boot - spring-boot-devtools - 3.4.0 - true - diff --git a/zhyc-module/pom.xml b/zhyc-module/pom.xml index a7beefd..a0b435f 100644 --- a/zhyc-module/pom.xml +++ b/zhyc-module/pom.xml @@ -17,6 +17,10 @@ zhyc zhyc-common + + org.projectlombok + lombok + \ No newline at end of file diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java new file mode 100644 index 0000000..0a4f67b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicTypeController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.SwMedicType; +import com.zhyc.module.biosafety.service.ISwMedicTypeService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 药品类型Controller + * + * @author ruoyi + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/biosafety/type") +public class SwMedicTypeController extends BaseController +{ + @Autowired + private ISwMedicTypeService swMedicTypeService; + + /** + * 查询药品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:list')") + @GetMapping("/list") + public TableDataInfo list(SwMedicType swMedicType) + { + startPage(); + List list = swMedicTypeService.selectSwMedicTypeList(swMedicType); + return getDataTable(list); + } + + /** + * 导出药品类型列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:export')") + @Log(title = "药品类型", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwMedicType swMedicType) + { + List list = swMedicTypeService.selectSwMedicTypeList(swMedicType); + ExcelUtil util = new ExcelUtil(SwMedicType.class); + util.exportExcel(response, list, "药品类型数据"); + } + + /** + * 获取药品类型详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swMedicTypeService.selectSwMedicTypeById(id)); + } + + /** + * 新增药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:add')") + @Log(title = "药品类型", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwMedicType swMedicType) + { + return toAjax(swMedicTypeService.insertSwMedicType(swMedicType)); + } + + /** + * 修改药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:edit')") + @Log(title = "药品类型", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwMedicType swMedicType) + { + return toAjax(swMedicTypeService.updateSwMedicType(swMedicType)); + } + + /** + * 删除药品类型 + */ + @PreAuthorize("@ss.hasPermi('biosafety:type:remove')") + @Log(title = "药品类型", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swMedicTypeService.deleteSwMedicTypeByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java new file mode 100644 index 0000000..c6cbc0f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwMedicineController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.SwMedicine; +import com.zhyc.module.biosafety.service.ISwMedicineService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 药品Controller + * + * @author ruoyi + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/system/medicine") +public class SwMedicineController extends BaseController +{ + @Autowired + private ISwMedicineService swMedicineService; + + /** + * 查询药品列表 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:list')") + @GetMapping("/list") + public TableDataInfo list(SwMedicine swMedicine) + { + startPage(); + List list = swMedicineService.selectSwMedicineList(swMedicine); + return getDataTable(list); + } + + /** + * 导出药品列表 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:export')") + @Log(title = "药品", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwMedicine swMedicine) + { + List list = swMedicineService.selectSwMedicineList(swMedicine); + ExcelUtil util = new ExcelUtil(SwMedicine.class); + util.exportExcel(response, list, "药品数据"); + } + + /** + * 获取药品详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swMedicineService.selectSwMedicineById(id)); + } + + /** + * 新增药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:add')") + @Log(title = "药品", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwMedicine swMedicine) + { + return toAjax(swMedicineService.insertSwMedicine(swMedicine)); + } + + /** + * 修改药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:edit')") + @Log(title = "药品", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwMedicine swMedicine) + { + return toAjax(swMedicineService.updateSwMedicine(swMedicine)); + } + + /** + * 删除药品 + */ + @PreAuthorize("@ss.hasPermi('system:medicine:remove')") + @Log(title = "药品", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swMedicineService.deleteSwMedicineByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java new file mode 100644 index 0000000..ea0c207 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/controller/SwUsageController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.biosafety.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.biosafety.domain.SwUsage; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.module.biosafety.service.ISwUsageService; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 药品使用方法Controller + * + * @author ruoyi + * @date 2025-07-11 + */ +@RestController +@RequestMapping("/biosafety/usage") +public class SwUsageController extends BaseController +{ + @Autowired + private ISwUsageService swUsageService; + + /** + * 查询药品使用方法列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:list')") + @GetMapping("/list") + public TableDataInfo list(SwUsage swUsage) + { + startPage(); + List list = swUsageService.selectSwUsageList(swUsage); + return getDataTable(list); + } + + /** + * 导出药品使用方法列表 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:export')") + @Log(title = "药品使用方法", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, SwUsage swUsage) + { + List list = swUsageService.selectSwUsageList(swUsage); + ExcelUtil util = new ExcelUtil(SwUsage.class); + util.exportExcel(response, list, "药品使用方法数据"); + } + + /** + * 获取药品使用方法详细信息 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(swUsageService.selectSwUsageById(id)); + } + + /** + * 新增药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:add')") + @Log(title = "药品使用方法", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody SwUsage swUsage) + { + return toAjax(swUsageService.insertSwUsage(swUsage)); + } + + /** + * 修改药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:edit')") + @Log(title = "药品使用方法", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody SwUsage swUsage) + { + return toAjax(swUsageService.updateSwUsage(swUsage)); + } + + /** + * 删除药品使用方法 + */ + @PreAuthorize("@ss.hasPermi('biosafety:usage:remove')") + @Log(title = "药品使用方法", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(swUsageService.deleteSwUsageByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java new file mode 100644 index 0000000..7bfcc56 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicType.java @@ -0,0 +1,52 @@ +package com.zhyc.module.biosafety.domain; + +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品类型对象 sw_medic_type + * + * @author ruoyi + * @date 2025-07-11 + */ +public class SwMedicType extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long id; + + /** 药品类型 */ + @Excel(name = "药品类型") + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setName(String name) + { + this.name = name; + } + + public String getName() + { + return name; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("name", getName()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java new file mode 100644 index 0000000..8536c1b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwMedicine.java @@ -0,0 +1,45 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品对象 sw_medicine + * + * @author ruoyi + * @date 2025-07-11 + */ + +@Data +public class SwMedicine extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** */ + private Long id; + + /** 药品编号 */ + @Excel(name = "药品编号") + private String medica; + + /** 药品名称 */ + @Excel(name = "药品名称") + private String name; + + /** 药品类型 */ + @Excel(name = "药品类型") + private Long medicType; + + /** 使用方法 */ + @Excel(name = "使用方法") + private Long usageId; + + /** 备注 */ + @Excel(name = "备注") + private String comment; + + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java new file mode 100644 index 0000000..91c065f --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/domain/SwUsage.java @@ -0,0 +1,37 @@ +package com.zhyc.module.biosafety.domain; + +import lombok.Data; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 药品使用方法对象 sw_usage + * + * @author ruoyi + * @date 2025-07-11 + */ +@Data +public class SwUsage extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 编号 */ + private Long id; + + /** 使用方法 */ + @Excel(name = "使用方法") + private String name; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java new file mode 100644 index 0000000..764c735 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicTypeMapper.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; + +/** + * 药品类型Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface SwMedicTypeMapper +{ + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + public SwMedicType selectSwMedicTypeById(Long id); + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型集合 + */ + public List selectSwMedicTypeList(SwMedicType swMedicType); + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int insertSwMedicType(SwMedicType swMedicType); + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int updateSwMedicType(SwMedicType swMedicType); + + /** + * 删除药品类型 + * + * @param id 药品类型主键 + * @return 结果 + */ + public int deleteSwMedicTypeById(Long id); + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicTypeByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java new file mode 100644 index 0000000..fc44d44 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwMedicineMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwMedicine; + +/** + * 药品Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface SwMedicineMapper +{ + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + public SwMedicine selectSwMedicineById(Long id); + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品集合 + */ + public List selectSwMedicineList(SwMedicine swMedicine); + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int insertSwMedicine(SwMedicine swMedicine); + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int updateSwMedicine(SwMedicine swMedicine); + + /** + * 删除药品 + * + * @param id 药品主键 + * @return 结果 + */ + public int deleteSwMedicineById(Long id); + + /** + * 批量删除药品 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwMedicineByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java new file mode 100644 index 0000000..cb0706d --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/mapper/SwUsageMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.mapper; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwUsage; + +/** + * 药品使用方法Mapper接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface SwUsageMapper +{ + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + public SwUsage selectSwUsageById(Long id); + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法集合 + */ + public List selectSwUsageList(SwUsage swUsage); + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int insertSwUsage(SwUsage swUsage); + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int updateSwUsage(SwUsage swUsage); + + /** + * 删除药品使用方法 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + public int deleteSwUsageById(Long id); + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteSwUsageByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java new file mode 100644 index 0000000..186af6c --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicTypeService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; + +/** + * 药品类型Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwMedicTypeService +{ + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + public SwMedicType selectSwMedicTypeById(Long id); + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型集合 + */ + public List selectSwMedicTypeList(SwMedicType swMedicType); + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int insertSwMedicType(SwMedicType swMedicType); + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + public int updateSwMedicType(SwMedicType swMedicType); + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的药品类型主键集合 + * @return 结果 + */ + public int deleteSwMedicTypeByIds(Long[] ids); + + /** + * 删除药品类型信息 + * + * @param id 药品类型主键 + * @return 结果 + */ + public int deleteSwMedicTypeById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java new file mode 100644 index 0000000..abc52b5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwMedicineService.java @@ -0,0 +1,62 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicine; + +/** + * 药品Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwMedicineService +{ + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + public SwMedicine selectSwMedicineById(Long id); + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品集合 + */ + public List selectSwMedicineList(SwMedicine swMedicine); + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int insertSwMedicine(SwMedicine swMedicine); + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + public int updateSwMedicine(SwMedicine swMedicine); + + /** + * 批量删除药品 + * + * @param ids 需要删除的药品主键集合 + * @return 结果 + */ + public int deleteSwMedicineByIds(Long[] ids); + + /** + * 删除药品信息 + * + * @param id 药品主键 + * @return 结果 + */ + public int deleteSwMedicineById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java new file mode 100644 index 0000000..e6d3152 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/ISwUsageService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.biosafety.service; + +import java.util.List; +import com.zhyc.module.biosafety.domain.SwUsage; + +/** + * 药品使用方法Service接口 + * + * @author ruoyi + * @date 2025-07-11 + */ +public interface ISwUsageService +{ + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + public SwUsage selectSwUsageById(Long id); + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法集合 + */ + public List selectSwUsageList(SwUsage swUsage); + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int insertSwUsage(SwUsage swUsage); + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + public int updateSwUsage(SwUsage swUsage); + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的药品使用方法主键集合 + * @return 结果 + */ + public int deleteSwUsageByIds(Long[] ids); + + /** + * 删除药品使用方法信息 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + public int deleteSwUsageById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java new file mode 100644 index 0000000..2e1b20a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicTypeServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicType; +import com.zhyc.module.biosafety.mapper.SwMedicTypeMapper; +import com.zhyc.module.biosafety.service.ISwMedicTypeService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品类型Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwMedicTypeServiceImpl implements ISwMedicTypeService +{ + @Autowired + private SwMedicTypeMapper swMedicTypeMapper; + + /** + * 查询药品类型 + * + * @param id 药品类型主键 + * @return 药品类型 + */ + @Override + public SwMedicType selectSwMedicTypeById(Long id) + { + return swMedicTypeMapper.selectSwMedicTypeById(id); + } + + /** + * 查询药品类型列表 + * + * @param swMedicType 药品类型 + * @return 药品类型 + */ + @Override + public List selectSwMedicTypeList(SwMedicType swMedicType) + { + return swMedicTypeMapper.selectSwMedicTypeList(swMedicType); + } + + /** + * 新增药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + @Override + public int insertSwMedicType(SwMedicType swMedicType) + { + return swMedicTypeMapper.insertSwMedicType(swMedicType); + } + + /** + * 修改药品类型 + * + * @param swMedicType 药品类型 + * @return 结果 + */ + @Override + public int updateSwMedicType(SwMedicType swMedicType) + { + return swMedicTypeMapper.updateSwMedicType(swMedicType); + } + + /** + * 批量删除药品类型 + * + * @param ids 需要删除的药品类型主键 + * @return 结果 + */ + @Override + public int deleteSwMedicTypeByIds(Long[] ids) + { + return swMedicTypeMapper.deleteSwMedicTypeByIds(ids); + } + + /** + * 删除药品类型信息 + * + * @param id 药品类型主键 + * @return 结果 + */ + @Override + public int deleteSwMedicTypeById(Long id) + { + return swMedicTypeMapper.deleteSwMedicTypeById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java new file mode 100644 index 0000000..78d9ba5 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwMedicineServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwMedicine; +import com.zhyc.module.biosafety.mapper.SwMedicineMapper; +import com.zhyc.module.biosafety.service.ISwMedicineService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwMedicineServiceImpl implements ISwMedicineService +{ + @Autowired + private SwMedicineMapper swMedicineMapper; + + /** + * 查询药品 + * + * @param id 药品主键 + * @return 药品 + */ + @Override + public SwMedicine selectSwMedicineById(Long id) + { + return swMedicineMapper.selectSwMedicineById(id); + } + + /** + * 查询药品列表 + * + * @param swMedicine 药品 + * @return 药品 + */ + @Override + public List selectSwMedicineList(SwMedicine swMedicine) + { + return swMedicineMapper.selectSwMedicineList(swMedicine); + } + + /** + * 新增药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + @Override + public int insertSwMedicine(SwMedicine swMedicine) + { + return swMedicineMapper.insertSwMedicine(swMedicine); + } + + /** + * 修改药品 + * + * @param swMedicine 药品 + * @return 结果 + */ + @Override + public int updateSwMedicine(SwMedicine swMedicine) + { + return swMedicineMapper.updateSwMedicine(swMedicine); + } + + /** + * 批量删除药品 + * + * @param ids 需要删除的药品主键 + * @return 结果 + */ + @Override + public int deleteSwMedicineByIds(Long[] ids) + { + return swMedicineMapper.deleteSwMedicineByIds(ids); + } + + /** + * 删除药品信息 + * + * @param id 药品主键 + * @return 结果 + */ + @Override + public int deleteSwMedicineById(Long id) + { + return swMedicineMapper.deleteSwMedicineById(id); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java new file mode 100644 index 0000000..203445b --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/biosafety/service/impl/SwUsageServiceImpl.java @@ -0,0 +1,94 @@ +package com.zhyc.module.biosafety.service.impl; + +import java.util.List; + +import com.zhyc.module.biosafety.domain.SwUsage; +import com.zhyc.module.biosafety.mapper.SwUsageMapper; +import com.zhyc.module.biosafety.service.ISwUsageService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +/** + * 药品使用方法Service业务层处理 + * + * @author ruoyi + * @date 2025-07-11 + */ +@Service +public class SwUsageServiceImpl implements ISwUsageService +{ + @Autowired + private SwUsageMapper swUsageMapper; + + /** + * 查询药品使用方法 + * + * @param id 药品使用方法主键 + * @return 药品使用方法 + */ + @Override + public SwUsage selectSwUsageById(Long id) + { + return swUsageMapper.selectSwUsageById(id); + } + + /** + * 查询药品使用方法列表 + * + * @param swUsage 药品使用方法 + * @return 药品使用方法 + */ + @Override + public List selectSwUsageList(SwUsage swUsage) + { + return swUsageMapper.selectSwUsageList(swUsage); + } + + /** + * 新增药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + @Override + public int insertSwUsage(SwUsage swUsage) + { + return swUsageMapper.insertSwUsage(swUsage); + } + + /** + * 修改药品使用方法 + * + * @param swUsage 药品使用方法 + * @return 结果 + */ + @Override + public int updateSwUsage(SwUsage swUsage) + { + return swUsageMapper.updateSwUsage(swUsage); + } + + /** + * 批量删除药品使用方法 + * + * @param ids 需要删除的药品使用方法主键 + * @return 结果 + */ + @Override + public int deleteSwUsageByIds(Long[] ids) + { + return swUsageMapper.deleteSwUsageByIds(ids); + } + + /** + * 删除药品使用方法信息 + * + * @param id 药品使用方法主键 + * @return 结果 + */ + @Override + public int deleteSwUsageById(Long id) + { + return swUsageMapper.deleteSwUsageById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/disease/SwDiseaseMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwDiseaseMapper.xml similarity index 100% rename from zhyc-module/src/main/resources/mapper/disease/SwDiseaseMapper.xml rename to zhyc-module/src/main/resources/mapper/biosafety/SwDiseaseMapper.xml diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml new file mode 100644 index 0000000..11d29ac --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicTypeMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_medic_type + + + + + + + + insert into sw_medic_type + + name, + + + #{name}, + + + + + update sw_medic_type + + name = #{name}, + + where id = #{id} + + + + delete from sw_medic_type where id = #{id} + + + + delete from sw_medic_type where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml new file mode 100644 index 0000000..663ff94 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwMedicineMapper.xml @@ -0,0 +1,76 @@ + + + + + + + + + + + + + + + select id, medica, name, medic_type, usage_id, comment from sw_medicine + + + + + + + + insert into sw_medicine + + medica, + name, + medic_type, + usage_id, + comment, + + + #{medica}, + #{name}, + #{medicType}, + #{usageId}, + #{comment}, + + + + + update sw_medicine + + medica = #{medica}, + name = #{name}, + medic_type = #{medicType}, + usage_id = #{usageId}, + comment = #{comment}, + + where id = #{id} + + + + delete from sw_medicine where id = #{id} + + + + delete from sw_medicine where id in + + #{id} + + + \ No newline at end of file diff --git a/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml b/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml new file mode 100644 index 0000000..ed4c37a --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/biosafety/SwUsageMapper.xml @@ -0,0 +1,56 @@ + + + + + + + + + + + select id, name from sw_usage + + + + + + + + insert into sw_usage + + name, + + + #{name}, + + + + + update sw_usage + + name = #{name}, + + where id = #{id} + + + + delete from sw_usage where id = #{id} + + + + delete from sw_usage where id in + + #{id} + + + \ No newline at end of file