Pārlūkot izejas kodu

体检报告模板

yjwang 2 dienas atpakaļ
vecāks
revīzija
a62116bd11

+ 114 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateController.java

@@ -0,0 +1,114 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.utils.ServletUtils;
+import com.fs.framework.web.service.TokenService;
+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.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.service.IFsPhysicalReportTemplateService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板Controller
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplate")
+public class FsPhysicalReportTemplateController extends BaseController
+{
+    @Autowired
+    private IFsPhysicalReportTemplateService fsPhysicalReportTemplateService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        startPage();
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:export')")
+    @Log(title = "体检报告模板", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        List<FsPhysicalReportTemplate> list = fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+        ExcelUtil<FsPhysicalReportTemplate> util = new ExcelUtil<FsPhysicalReportTemplate>(FsPhysicalReportTemplate.class);
+        return util.exportExcel(list, "体检报告模板数据");
+    }
+
+    /**
+     * 获取体检报告模板详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id)
+    {
+        return AjaxResult.success(fsPhysicalReportTemplateService.selectFsPhysicalReportTemplateById(id));
+    }
+
+    /**
+     * 新增体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:add')")
+    @Log(title = "体检报告模板", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.insertFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 修改体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:edit')")
+    @Log(title = "体检报告模板", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplate fsPhysicalReportTemplate)
+    {
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fsPhysicalReportTemplate.setUpdateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateService.updateFsPhysicalReportTemplate(fsPhysicalReportTemplate));
+    }
+
+    /**
+     * 删除体检报告模板
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplate:remove')")
+    @Log(title = "体检报告模板", businessType = BusinessType.DELETE)
+	@DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids)
+    {
+        return toAjax(fsPhysicalReportTemplateService.deleteFsPhysicalReportTemplateByIds(ids));
+    }
+}

+ 140 - 0
fs-admin/src/main/java/com/fs/his/controller/FsPhysicalReportTemplateFieldController.java

@@ -0,0 +1,140 @@
+package com.fs.his.controller;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.core.domain.model.LoginUser;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.ServletUtils;
+import com.fs.common.utils.StringUtils;
+import com.fs.framework.web.service.TokenService;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+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.fs.common.annotation.Log;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.AjaxResult;
+import com.fs.common.enums.BusinessType;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.service.IFsPhysicalReportTemplateFieldService;
+import com.fs.common.utils.poi.ExcelUtil;
+import com.fs.common.core.page.TableDataInfo;
+
+/**
+ * 体检报告模板字段Controller
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@RestController
+@RequestMapping("/his/physicalReportTemplateField")
+public class FsPhysicalReportTemplateFieldController extends BaseController {
+    @Autowired
+    private IFsPhysicalReportTemplateFieldService fsPhysicalReportTemplateFieldService;
+
+    @Autowired
+    private TokenService tokenService;
+
+    /**
+     * 查询体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        startPage();
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出体检报告模板字段列表
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:export')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.EXPORT)
+    @GetMapping("/export")
+    public AjaxResult export(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        List<FsPhysicalReportTemplateField> list = fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+        ExcelUtil<FsPhysicalReportTemplateField> util = new ExcelUtil<FsPhysicalReportTemplateField>(FsPhysicalReportTemplateField.class);
+        return util.exportExcel(list, "体检报告模板字段数据");
+    }
+
+    /**
+     * 获取体检报告模板字段详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") String id) {
+        return AjaxResult.success(fsPhysicalReportTemplateFieldService.selectFsPhysicalReportTemplateFieldById(id));
+    }
+
+    /**
+     * 新增体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:add')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.insertFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 修改体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:edit')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return toAjax(fsPhysicalReportTemplateFieldService.updateFsPhysicalReportTemplateField(fsPhysicalReportTemplateField));
+    }
+
+    /**
+     * 删除体检报告模板字段
+     */
+    @PreAuthorize("@ss.hasPermi('his:physicalReportTemplateField:remove')")
+    @Log(title = "体检报告模板字段", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable String[] ids) {
+        return toAjax(fsPhysicalReportTemplateFieldService.deleteFsPhysicalReportTemplateFieldByIds(ids));
+    }
+
+    /**
+     * 获取模板自定义字段
+     *
+     * @param templateId 模板ID
+     * @return R
+     **/
+    @PostMapping("/getTemplateField/{templateId}")
+    public R getTemplateField(@PathVariable String templateId) {
+        if (StringUtils.isNull(templateId)) {
+            return R.failed("操作失败,模板ID不能为空!");
+        }
+        return fsPhysicalReportTemplateFieldService.getTemplateField(templateId);
+    }
+
+    /**
+     * 新增模板
+     *
+     * @param fieldDTO
+     * @return AjaxResult
+     **/
+    @Log(title = "体检报告模板字段", businessType = BusinessType.INSERT)
+    @PostMapping("/saveTemplate")
+    public AjaxResult saveTemplate(@RequestBody FsPhysicalReportTemplateFieldDTO fieldDTO) {
+        if (StringUtils.isNull(fieldDTO.getTemplateId())) {
+            throw new ServiceException("操作失败,模板ID不能为空!");
+        } else if (fieldDTO.getTemplateFieldList().isEmpty()) {
+            throw new ServiceException("操作失败,字段列表不能为空!");
+        }
+        LoginUser loginUser = tokenService.getLoginUser(ServletUtils.getRequest());
+        fieldDTO.setCreateBy(String.valueOf(loginUser.getUserId()));
+        return toAjax(fsPhysicalReportTemplateFieldService.saveFsPhysicalReportTemplateField(fieldDTO));
+    }
+}

+ 32 - 0
fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplate.java

@@ -0,0 +1,32 @@
+package com.fs.his.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 体检报告模板对象 fs_physical_report_template
+ *
+ * @author fs
+ * @date 2025-07-23
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsPhysicalReportTemplate extends BaseEntity{
+
+    /** 体检模板ID */
+    @Excel(name = "模板编码")
+    private Long id;
+
+    /** 体检模板名称 */
+    @Excel(name = "模板名称")
+    private String templateName;
+
+    /** 状态(0未启用、1启用) */
+    @Excel(name = "状态", readConverterExp = "0=未启用、1启用")
+    private String status;
+
+
+}

+ 72 - 0
fs-service/src/main/java/com/fs/his/domain/FsPhysicalReportTemplateField.java

@@ -0,0 +1,72 @@
+package com.fs.his.domain;
+
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.fs.common.annotation.Excel;
+import lombok.Data;
+import com.fs.common.core.domain.BaseEntity;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 体检报告模板字段对象 fs_physical_report_template_field
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class FsPhysicalReportTemplateField extends BaseEntity{
+
+    /** 字段id */
+    private String id;
+
+    /** 模板ID */
+    @Excel(name = "模板ID")
+    private Long templateId;
+
+    /** 组件ID,后续可联动组件 */
+    @Excel(name = "组件ID,后续可联动组件")
+    private Long componentId;
+
+    /** 字段组件名称 */
+    @Excel(name = "字段组件名称")
+    private String label;
+
+    /** 字段类型 */
+    @Excel(name = "字段类型")
+    private String type;
+
+    /** 排序 */
+    @Excel(name = "排序")
+    private Integer sort;
+
+    /** 是否必填0否1是 */
+    @Excel(name = "是否必填0否1是")
+    private Integer required;
+
+    /** 是否多选0否1是 */
+    @Excel(name = "是否多选0否1是")
+    private Integer multiple;
+
+    /** 多选下来数据 */
+    @Excel(name = "多选下来数据")
+    private String multiples;
+
+    /** 输入框最大长度 */
+    @Excel(name = "输入框最大长度")
+    private Long maxLength;
+
+    /** 输入框最小长度 */
+    @Excel(name = "输入框最小长度")
+    private Long minLength;
+
+    /** 状态(1未启用、2启用) */
+    @Excel(name = "状态", readConverterExp = "1=未启用、2启用")
+    private Long status;
+
+    /**
+     * 下拉多选,复选框多选值
+     * **/
+    private String options;
+
+
+}

+ 19 - 0
fs-service/src/main/java/com/fs/his/dto/FsPhysicalReportTemplateFieldDTO.java

@@ -0,0 +1,19 @@
+package com.fs.his.dto;
+
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.List;
+
+@Data
+public class FsPhysicalReportTemplateFieldDTO implements Serializable {
+    //模板ID
+    private Long templateId;
+
+    //自定义字段类型
+    private List<FsPhysicalReportTemplateField> templateFieldList;
+
+    //创建人
+    private String createBy;
+}

+ 75 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateFieldMapper.java

@@ -0,0 +1,75 @@
+package com.fs.his.mapper;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import org.apache.ibatis.annotations.Param;
+
+/**
+ * 体检报告模板字段Mapper接口
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+public interface FsPhysicalReportTemplateFieldMapper extends BaseMapper<FsPhysicalReportTemplateField> {
+    /**
+     * 查询体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 查询体检报告模板字段列表
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段集合
+     */
+    List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 修改体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 删除体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 批量删除体检报告模板字段
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldByIds(String[] ids);
+
+    /**
+     * 批量插入模板自定义字段
+     *
+     * @param templateFieldList 插入数据
+     **/
+    void batchInsertFsPhysicalReportTemplateField(@Param("templateFieldList") List<FsPhysicalReportTemplateField> templateFieldList);
+
+    /**
+     * 删除自定也模板
+     * **/
+    void deleteTemplateFieldByTemplateId(@Param("templateId") Long templateId);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/mapper/FsPhysicalReportTemplateMapper.java

@@ -0,0 +1,61 @@
+package com.fs.his.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+
+/**
+ * 体检报告模板Mapper接口
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+public interface FsPhysicalReportTemplateMapper extends BaseMapper<FsPhysicalReportTemplate>{
+    /**
+     * 查询体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 查询体检报告模板列表
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板集合
+     */
+    List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 新增体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 修改体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 删除体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 批量删除体检报告模板
+     * 
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateByIds(String[] ids);
+}

+ 80 - 0
fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateFieldService.java

@@ -0,0 +1,80 @@
+package com.fs.his.service;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.extension.api.R;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+
+/**
+ * 体检报告模板字段Service接口
+ * 
+ * @author fs
+ * @date 2025-07-24
+ */
+public interface IFsPhysicalReportTemplateFieldService extends IService<FsPhysicalReportTemplateField>{
+    /**
+     * 查询体检报告模板字段
+     * 
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 查询体检报告模板字段列表
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段集合
+     */
+    List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 新增体检报告模板字段
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 修改体检报告模板字段
+     * 
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField);
+
+    /**
+     * 批量删除体检报告模板字段
+     * 
+     * @param ids 需要删除的体检报告模板字段主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldByIds(String[] ids);
+
+    /**
+     * 删除体检报告模板字段信息
+     * 
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateFieldById(String id);
+
+    /**
+     * 获取模板自定义字段
+     * @param templateId 模板ID
+     * @return R
+     * **/
+    R getTemplateField(String templateId);
+
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fieldDTO 体检报告模板字段
+     * @return 结果
+     */
+    int saveFsPhysicalReportTemplateField(FsPhysicalReportTemplateFieldDTO fieldDTO);
+}

+ 61 - 0
fs-service/src/main/java/com/fs/his/service/IFsPhysicalReportTemplateService.java

@@ -0,0 +1,61 @@
+package com.fs.his.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+
+/**
+ * 体检报告模板Service接口
+ * 
+ * @author fs
+ * @date 2025-07-23
+ */
+public interface IFsPhysicalReportTemplateService extends IService<FsPhysicalReportTemplate>{
+    /**
+     * 查询体检报告模板
+     * 
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id);
+
+    /**
+     * 查询体检报告模板列表
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板集合
+     */
+    List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 新增体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 修改体检报告模板
+     * 
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate);
+
+    /**
+     * 批量删除体检报告模板
+     * 
+     * @param ids 需要删除的体检报告模板主键集合
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateByIds(String[] ids);
+
+    /**
+     * 删除体检报告模板信息
+     * 
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    int deleteFsPhysicalReportTemplateById(String id);
+}

+ 153 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateFieldServiceImpl.java

@@ -0,0 +1,153 @@
+package com.fs.his.service.impl;
+
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.atomic.AtomicInteger;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.api.R;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.StringUtils;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.dto.FsPhysicalReportTemplateFieldDTO;
+import com.fs.his.mapper.FsPhysicalReportTemplateMapper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.his.mapper.FsPhysicalReportTemplateFieldMapper;
+import com.fs.his.domain.FsPhysicalReportTemplateField;
+import com.fs.his.service.IFsPhysicalReportTemplateFieldService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 体检报告模板字段Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-24
+ */
+@Service
+public class FsPhysicalReportTemplateFieldServiceImpl extends ServiceImpl<FsPhysicalReportTemplateFieldMapper, FsPhysicalReportTemplateField> implements IFsPhysicalReportTemplateFieldService {
+
+    @Autowired
+    private FsPhysicalReportTemplateMapper physicalReportTemplateMapper;
+
+
+    /**
+     * 查询体检报告模板字段
+     *
+     * @param id 体检报告模板字段主键
+     * @return 体检报告模板字段
+     */
+    @Override
+    public FsPhysicalReportTemplateField selectFsPhysicalReportTemplateFieldById(String id) {
+        return baseMapper.selectFsPhysicalReportTemplateFieldById(id);
+    }
+
+    /**
+     * 查询体检报告模板字段列表
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 体检报告模板字段
+     */
+    @Override
+    public List<FsPhysicalReportTemplateField> selectFsPhysicalReportTemplateFieldList(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        return baseMapper.selectFsPhysicalReportTemplateFieldList(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 新增体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    @Override
+    public int insertFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        fsPhysicalReportTemplateField.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsPhysicalReportTemplateField(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 修改体检报告模板字段
+     *
+     * @param fsPhysicalReportTemplateField 体检报告模板字段
+     * @return 结果
+     */
+    @Override
+    public int updateFsPhysicalReportTemplateField(FsPhysicalReportTemplateField fsPhysicalReportTemplateField) {
+        fsPhysicalReportTemplateField.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsPhysicalReportTemplateField(fsPhysicalReportTemplateField);
+    }
+
+    /**
+     * 批量删除体检报告模板字段
+     *
+     * @param ids 需要删除的体检报告模板字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateFieldByIds(String[] ids) {
+        return baseMapper.deleteFsPhysicalReportTemplateFieldByIds(ids);
+    }
+
+    /**
+     * 删除体检报告模板字段信息
+     *
+     * @param id 体检报告模板字段主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateFieldById(String id) {
+        return baseMapper.deleteFsPhysicalReportTemplateFieldById(id);
+    }
+
+    @Override
+    public R getTemplateField(String templateId) {
+        //查询模板信息是否存在
+        FsPhysicalReportTemplate reportTemplate = physicalReportTemplateMapper.selectById(templateId);
+        if (StringUtils.isNull(reportTemplate)) {
+            return R.failed("操作失败,模板信息不存在!");
+        } else if (!reportTemplate.getStatus().equals("1")) {
+            return R.failed("操作失败,当前模板已禁用!");
+        }
+
+        //查询模板下自定义数据信息
+        return R.ok(baseMapper.selectList(new LambdaQueryWrapper<FsPhysicalReportTemplateField>().eq(FsPhysicalReportTemplateField::getTemplateId, templateId).orderByAsc(FsPhysicalReportTemplateField::getSort)));
+    }
+
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int saveFsPhysicalReportTemplateField(FsPhysicalReportTemplateFieldDTO fieldDTO) {
+        //查询模板信息是否存在
+        FsPhysicalReportTemplate reportTemplate = physicalReportTemplateMapper.selectById(fieldDTO.getTemplateId());
+        if (StringUtils.isNull(reportTemplate)) {
+            throw new ServiceException("操作失败,模板信息不存在!");
+        } else if (!reportTemplate.getStatus().equals("1")) {
+            throw new ServiceException("操作失败,当前模板已禁用!");
+        }
+
+        //验证数据主要数据是否存在
+        AtomicInteger num = new AtomicInteger();
+        Date date=new Date();
+        fieldDTO.getTemplateFieldList().forEach(t -> {
+            num.getAndIncrement();
+            if (StringUtils.isNull(t.getComponentId())) {
+                throw new ServiceException("操作失败,模板ID不能为空!");
+            } else if (StringUtils.isNull(t.getLabel())) {
+                throw new ServiceException("操作失败,组件名称不能为空!");
+            } else if (StringUtils.isNull(t.getType())) {
+                throw new ServiceException("操作失败,字段类型不能为空!");
+            }
+            t.setCreateBy(fieldDTO.getCreateBy());
+            t.setTemplateId(reportTemplate.getId());
+            t.setCreateTime(date);
+            t.setSort(num.get());
+        });
+
+        //删除相关数据
+        baseMapper.deleteTemplateFieldByTemplateId(reportTemplate.getId());
+        //批量插入
+        baseMapper.batchInsertFsPhysicalReportTemplateField(fieldDTO.getTemplateFieldList());
+        return 1;
+    }
+}

+ 125 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsPhysicalReportTemplateServiceImpl.java

@@ -0,0 +1,125 @@
+package com.fs.his.service.impl;
+
+import java.util.List;
+
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
+import com.baomidou.mybatisplus.extension.service.additional.query.impl.LambdaQueryChainWrapper;
+import com.fs.common.exception.ServiceException;
+import com.fs.common.utils.DateUtils;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.fs.common.utils.StringUtils;
+import com.fs.huifuPay.sdk.opps.core.utils.ObjectUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.fs.his.mapper.FsPhysicalReportTemplateMapper;
+import com.fs.his.domain.FsPhysicalReportTemplate;
+import com.fs.his.service.IFsPhysicalReportTemplateService;
+import org.springframework.transaction.annotation.Transactional;
+
+/**
+ * 体检报告模板Service业务层处理
+ *
+ * @author fs
+ * @date 2025-07-23
+ */
+@Service
+public class FsPhysicalReportTemplateServiceImpl extends ServiceImpl<FsPhysicalReportTemplateMapper, FsPhysicalReportTemplate> implements IFsPhysicalReportTemplateService {
+
+    /**
+     * 查询体检报告模板
+     *
+     * @param id 体检报告模板主键
+     * @return 体检报告模板
+     */
+    @Override
+    public FsPhysicalReportTemplate selectFsPhysicalReportTemplateById(String id) {
+        return baseMapper.selectFsPhysicalReportTemplateById(id);
+    }
+
+    /**
+     * 查询体检报告模板列表
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 体检报告模板
+     */
+    @Override
+    public List<FsPhysicalReportTemplate> selectFsPhysicalReportTemplateList(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        return baseMapper.selectFsPhysicalReportTemplateList(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 新增体检报告模板
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int insertFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        //验证模板是否存在
+        if (baseMapper.selectCount(new LambdaQueryWrapper<FsPhysicalReportTemplate>().eq(FsPhysicalReportTemplate::getTemplateName, fsPhysicalReportTemplate.getTemplateName()).eq(FsPhysicalReportTemplate::getStatus, "1")) > 0) {
+            throw new ServiceException("操作失败,当前模板:" + fsPhysicalReportTemplate.getTemplateName() + "名称已存在!");
+        }
+
+        fsPhysicalReportTemplate.setCreateTime(DateUtils.getNowDate());
+        return baseMapper.insertFsPhysicalReportTemplate(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 修改体检报告模板
+     *
+     * @param fsPhysicalReportTemplate 体检报告模板
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int updateFsPhysicalReportTemplate(FsPhysicalReportTemplate fsPhysicalReportTemplate) {
+        //验证修改数据是否存在
+        FsPhysicalReportTemplate reportTemplate = baseMapper.selectById(fsPhysicalReportTemplate.getId());
+        if (StringUtils.isNull(reportTemplate)) {
+            throw new ServiceException("操作失败,修改数据不存在!");
+        }
+
+        //验证模板是否存在
+        if (baseMapper.selectCount(new LambdaQueryWrapper<FsPhysicalReportTemplate>().eq(FsPhysicalReportTemplate::getTemplateName, fsPhysicalReportTemplate.getTemplateName()).eq(FsPhysicalReportTemplate::getStatus, "1").ne(FsPhysicalReportTemplate::getId, fsPhysicalReportTemplate.getId())) > 0) {
+            throw new ServiceException("操作失败,当前模板:" + fsPhysicalReportTemplate.getTemplateName() + "名称已存在!");
+        }
+
+        fsPhysicalReportTemplate.setUpdateTime(DateUtils.getNowDate());
+        return baseMapper.updateFsPhysicalReportTemplate(fsPhysicalReportTemplate);
+    }
+
+    /**
+     * 批量删除体检报告模板
+     *
+     * @param ids 需要删除的体检报告模板主键
+     * @return 结果
+     */
+    @Override
+    @Transactional(rollbackFor = Exception.class)
+    public int deleteFsPhysicalReportTemplateByIds(String[] ids) {
+        //验证删除数据是否存在启用数据
+        List<FsPhysicalReportTemplate> reportTemplateList = baseMapper.selectList(new LambdaQueryWrapper<FsPhysicalReportTemplate>().in(FsPhysicalReportTemplate::getId, ids));
+        if (reportTemplateList.isEmpty() || reportTemplateList.size() != ids.length) {
+            throw new ServiceException("操作失败,删除数据不匹配!");
+        }
+        //校验数据数据状态是否
+        String templateName = reportTemplateList.stream().filter(r -> r.getStatus().equals("1")).findFirst().map(FsPhysicalReportTemplate::getTemplateName).orElse(null);
+        if (StringUtils.isNotEmpty(templateName)) {
+            throw new ServiceException("操作失败,当前模板:" + templateName + "正在启用中,无法删除!");
+        }
+
+        return baseMapper.deleteFsPhysicalReportTemplateByIds(ids);
+    }
+
+    /**
+     * 删除体检报告模板信息
+     *
+     * @param id 体检报告模板主键
+     * @return 结果
+     */
+    @Override
+    public int deleteFsPhysicalReportTemplateById(String id) {
+        return baseMapper.deleteFsPhysicalReportTemplateById(id);
+    }
+}

+ 175 - 0
fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateFieldMapper.xml

@@ -0,0 +1,175 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.FsPhysicalReportTemplateFieldMapper">
+    
+    <resultMap type="FsPhysicalReportTemplateField" id="FsPhysicalReportTemplateFieldResult">
+        <result property="id"    column="id"    />
+        <result property="templateId"    column="template_id"    />
+        <result property="componentId"    column="component_id"    />
+        <result property="label"    column="label"    />
+        <result property="remark"    column="remark"    />
+        <result property="type"    column="type"    />
+        <result property="sort"    column="sort"    />
+        <result property="required"    column="required"    />
+        <result property="multiple"    column="multiple"    />
+        <result property="multiples"    column="multiples"    />
+        <result property="maxLength"    column="max_length"    />
+        <result property="minLength"    column="min_length"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectFsPhysicalReportTemplateFieldVo">
+        select id, template_id, component_id, label, remark, type, sort, required, multiple, multiples, max_length, min_length, create_time, update_time, status, create_by, update_by from fs_physical_report_template_field
+    </sql>
+
+    <select id="selectFsPhysicalReportTemplateFieldList" parameterType="FsPhysicalReportTemplateField" resultMap="FsPhysicalReportTemplateFieldResult">
+        <include refid="selectFsPhysicalReportTemplateFieldVo"/>
+        <where>  
+            <if test="templateId != null "> and template_id = #{templateId}</if>
+            <if test="componentId != null "> and component_id = #{componentId}</if>
+            <if test="label != null  and label != ''"> and label = #{label}</if>
+            <if test="type != null  and type != ''"> and type = #{type}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="required != null "> and required = #{required}</if>
+            <if test="multiple != null "> and multiple = #{multiple}</if>
+            <if test="multiples != null  and multiples != ''"> and multiples = #{multiples}</if>
+            <if test="maxLength != null "> and max_length = #{maxLength}</if>
+            <if test="minLength != null "> and min_length = #{minLength}</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectFsPhysicalReportTemplateFieldById" parameterType="String" resultMap="FsPhysicalReportTemplateFieldResult">
+        <include refid="selectFsPhysicalReportTemplateFieldVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsPhysicalReportTemplateField" parameterType="FsPhysicalReportTemplateField" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_physical_report_template_field
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="templateId != null">template_id,</if>
+            <if test="componentId != null">component_id,</if>
+            <if test="label != null and label != ''">label,</if>
+            <if test="remark != null">remark,</if>
+            <if test="type != null and type != ''">type,</if>
+            <if test="sort != null">sort,</if>
+            <if test="required != null">required,</if>
+            <if test="multiple != null">multiple,</if>
+            <if test="multiples != null">multiples,</if>
+            <if test="maxLength != null">max_length,</if>
+            <if test="minLength != null">min_length,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="templateId != null">#{templateId},</if>
+            <if test="componentId != null">#{componentId},</if>
+            <if test="label != null and label != ''">#{label},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="type != null and type != ''">#{type},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="required != null">#{required},</if>
+            <if test="multiple != null">#{multiple},</if>
+            <if test="multiples != null">#{multiples},</if>
+            <if test="maxLength != null">#{maxLength},</if>
+            <if test="minLength != null">#{minLength},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsPhysicalReportTemplateField" parameterType="FsPhysicalReportTemplateField">
+        update fs_physical_report_template_field
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="templateId != null">template_id = #{templateId},</if>
+            <if test="componentId != null">component_id = #{componentId},</if>
+            <if test="label != null and label != ''">label = #{label},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="type != null and type != ''">type = #{type},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="required != null">required = #{required},</if>
+            <if test="multiple != null">multiple = #{multiple},</if>
+            <if test="multiples != null">multiples = #{multiples},</if>
+            <if test="maxLength != null">max_length = #{maxLength},</if>
+            <if test="minLength != null">min_length = #{minLength},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsPhysicalReportTemplateFieldById" parameterType="String">
+        delete from fs_physical_report_template_field where id = #{id}
+    </delete>
+
+    <delete id="deleteFsPhysicalReportTemplateFieldByIds" parameterType="String">
+        delete from fs_physical_report_template_field where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+
+    <insert id="batchInsertFsPhysicalReportTemplateField" parameterType="java.util.List">
+        insert into fs_physical_report_template_field
+        (
+        template_id,
+        component_id,
+        label,
+        remark,
+        type,
+        sort,
+        required,
+        multiple,
+        multiples,
+        max_length,
+        min_length,
+        create_time,
+        update_time,
+        status,
+        create_by,
+        update_by,
+        options
+        )
+        values
+        <foreach collection="templateFieldList" index="index" item="item" separator=",">
+            (
+            #{item.templateId},
+            #{item.componentId},
+            #{item.label},
+            #{item.remark},
+            #{item.type},
+            #{item.sort},
+            #{item.required},
+            #{item.multiple},
+            #{item.multiples},
+            #{item.maxLength},
+            #{item.minLength},
+            #{item.createTime},
+            #{item.updateTime},
+            #{item.status},
+            #{item.createBy},
+            #{item.updateBy},
+            #{item.options}
+            )
+        </foreach>
+    </insert>
+
+    <delete id="deleteTemplateFieldByTemplateId">
+        delete from fs_physical_report_template_field where template_id = #{templateId}
+    </delete>
+</mapper>

+ 81 - 0
fs-service/src/main/resources/mapper/his/FsPhysicalReportTemplateMapper.xml

@@ -0,0 +1,81 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.fs.his.mapper.FsPhysicalReportTemplateMapper">
+    
+    <resultMap type="FsPhysicalReportTemplate" id="FsPhysicalReportTemplateResult">
+        <result property="id"    column="id"    />
+        <result property="templateName"    column="template_name"    />
+        <result property="remark"    column="remark"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="status"    column="status"    />
+        <result property="createBy"    column="create_by"    />
+        <result property="updateBy"    column="update_by"    />
+    </resultMap>
+
+    <sql id="selectFsPhysicalReportTemplateVo">
+        select id, template_name, remark, create_time, update_time, status, create_by, update_by from fs_physical_report_template
+    </sql>
+
+    <select id="selectFsPhysicalReportTemplateList" parameterType="FsPhysicalReportTemplate" resultMap="FsPhysicalReportTemplateResult">
+        <include refid="selectFsPhysicalReportTemplateVo"/>
+        <where>  
+            <if test="templateName != null  and templateName != ''"> and template_name like concat('%', #{templateName}, '%')</if>
+            <if test="status != null "> and status = #{status}</if>
+        </where>
+    </select>
+    
+    <select id="selectFsPhysicalReportTemplateById" parameterType="String" resultMap="FsPhysicalReportTemplateResult">
+        <include refid="selectFsPhysicalReportTemplateVo"/>
+        where id = #{id}
+    </select>
+        
+    <insert id="insertFsPhysicalReportTemplate" parameterType="FsPhysicalReportTemplate" useGeneratedKeys="true" keyProperty="id">
+        insert into fs_physical_report_template
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">template_name,</if>
+            <if test="remark != null">remark,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="status != null">status,</if>
+            <if test="createBy != null">create_by,</if>
+            <if test="updateBy != null">update_by,</if>
+         </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">#{templateName},</if>
+            <if test="remark != null">#{remark},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="status != null">#{status},</if>
+            <if test="createBy != null">#{createBy},</if>
+            <if test="updateBy != null">#{updateBy},</if>
+         </trim>
+    </insert>
+
+    <update id="updateFsPhysicalReportTemplate" parameterType="FsPhysicalReportTemplate">
+        update fs_physical_report_template
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="templateName != null and templateName != ''">template_name = #{templateName},</if>
+            <if test="remark != null">remark = #{remark},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="status != null">status = #{status},</if>
+            <if test="createBy != null">create_by = #{createBy},</if>
+            <if test="updateBy != null">update_by = #{updateBy},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteFsPhysicalReportTemplateById" parameterType="String">
+        delete from fs_physical_report_template where id = #{id}
+    </delete>
+
+    <delete id="deleteFsPhysicalReportTemplateByIds" parameterType="String">
+        delete from fs_physical_report_template where id in 
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>