cgp 16 часов назад
Родитель
Сommit
eed2eb6221

+ 91 - 0
fs-doctor-app/src/main/java/com/fs/app/controller/PrescribeCommonController.java

@@ -0,0 +1,91 @@
+package com.fs.app.controller;
+
+import com.fs.app.annotation.Login;
+import com.fs.common.core.controller.BaseController;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsDoctorPrescribeCommon;
+import com.fs.his.param.FsDiagnosisListDParam;
+import com.fs.his.param.FsDoctorPrescribeCommonQueryParam;
+import com.fs.his.service.IFsDoctorPrescribeCommonService;
+import com.fs.his.vo.FsDiagnosisListDVO;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 医生常用诊断/建议用语 控制器
+ */
+@Api("医生常用语管理")
+@RestController
+@RequestMapping("/app/prescribe/common")
+public class PrescribeCommonController extends BaseController {
+
+    @Autowired
+    private IFsDoctorPrescribeCommonService fsDoctorPrescribeCommonService;
+
+    /**
+     * 分页查询常用语列表
+     */
+    @ApiOperation("查询常用语列表")
+    @GetMapping("/getPrescribeCommonList")
+    public R getPrescribeCommonList(FsDoctorPrescribeCommonQueryParam param){
+        PageInfo<FsDoctorPrescribeCommon> list = fsDoctorPrescribeCommonService.getList(param);
+        return R.ok().put("data", list);
+    }
+
+    /**
+     * 根据ID查询
+     */
+    @ApiOperation("根据ID查询常用语")
+    @GetMapping("/{commonId}")
+    public R getInfo(@PathVariable Long commonId) {
+        FsDoctorPrescribeCommon prescribeCommon = fsDoctorPrescribeCommonService.getById(commonId);
+        return R.ok().put("data",prescribeCommon);
+    }
+
+    /**
+     * 新增常用语
+     */
+    @ApiOperation("新增常用语")
+    @PostMapping
+    public R add(@Validated @RequestBody FsDoctorPrescribeCommon common) {
+        fsDoctorPrescribeCommonService.save(common);
+        return R.ok("操作成功");
+    }
+
+    /**
+     * 修改常用语
+     */
+    @ApiOperation("修改常用语")
+    @PutMapping
+    public R edit(@Validated @RequestBody FsDoctorPrescribeCommon common) {
+        fsDoctorPrescribeCommonService.update(common);
+        return R.ok("操作成功");
+    }
+
+    /**
+     * 删除常用语
+     */
+    @ApiOperation("删除常用语")
+    @DeleteMapping("/{commonId}")
+    public R remove(@PathVariable Long commonId) {
+        fsDoctorPrescribeCommonService.removeById(commonId);
+        return R.ok("操作成功");
+    }
+
+    /**
+     * 批量删除
+     */
+    @ApiOperation("批量删除常用语")
+    @DeleteMapping("/batch/{ids}")
+    public R batchRemove(@PathVariable Long[] ids) {
+        fsDoctorPrescribeCommonService.removeByIds(ids);
+        return R.ok("操作成功");
+    }
+}

+ 43 - 0
fs-service/src/main/java/com/fs/his/domain/FsDoctorPrescribeCommon.java

@@ -0,0 +1,43 @@
+package com.fs.his.domain;
+
+import com.fs.common.core.domain.BaseEntity;
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 医生常用诊断/建议用语对象 fs_doctor_prescribe_common
+ *
+ * @author fs
+ * @date 2025-03-28
+ */
+@Data
+public class FsDoctorPrescribeCommon extends BaseEntity {
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * 主键ID
+     */
+    private Long commonId;
+
+    /**
+     * 内容类型 1:诊断 2:建议
+     */
+    private Integer commonType;
+
+    /**
+     * 文字内容
+     */
+    private String textContent;
+
+    /**
+     * 医生ID
+     */
+    private Long doctorId;
+
+    /**
+     * 创建时间
+     */
+    private Date createTime;
+
+}

+ 44 - 0
fs-service/src/main/java/com/fs/his/mapper/FsDoctorPrescribeCommonMapper.java

@@ -0,0 +1,44 @@
+package com.fs.his.mapper;
+
+import com.fs.his.domain.FsDoctorPrescribeCommon;
+import com.fs.his.param.FsDoctorPrescribeCommonQueryParam;
+import org.apache.ibatis.annotations.Mapper;
+import org.apache.ibatis.annotations.Param;
+
+import java.util.List;
+
+/**
+ * 医生常用诊断/建议用语Mapper接口
+ */
+@Mapper
+public interface FsDoctorPrescribeCommonMapper {
+    /**
+     * 查询医生常用语列表
+     */
+    List<FsDoctorPrescribeCommon> selectFsDoctorPrescribeCommonList(@Param("query") FsDoctorPrescribeCommonQueryParam query);
+
+    /**
+     * 根据ID查询医生常用语
+     */
+    FsDoctorPrescribeCommon selectFsDoctorPrescribeCommonById(Long commonId);
+
+    /**
+     * 新增医生常用语
+     */
+    int insertFsDoctorPrescribeCommon(FsDoctorPrescribeCommon common);
+
+    /**
+     * 修改医生常用语
+     */
+    int updateFsDoctorPrescribeCommon(FsDoctorPrescribeCommon common);
+
+    /**
+     * 删除医生常用语
+     */
+    int deleteFsDoctorPrescribeCommonById(Long commonId);
+
+    /**
+     * 批量删除医生常用语
+     */
+    int deleteFsDoctorPrescribeCommonByIds(Long[] commonIds);
+}

+ 20 - 0
fs-service/src/main/java/com/fs/his/param/FsDoctorPrescribeCommonQueryParam.java

@@ -0,0 +1,20 @@
+package com.fs.his.param;
+
+import com.fs.common.core.page.PageDomain;
+import lombok.Data;
+
+/**
+ * 医生常用语查询参数
+ */
+@Data
+public class FsDoctorPrescribeCommonQueryParam extends PageDomain {
+    /**
+     * 内容类型 1:诊断 2:建议
+     */
+    private Integer commonType;
+
+    /**
+     * 文字内容(用于模糊查询)
+     */
+    private String textContent;
+}

+ 43 - 0
fs-service/src/main/java/com/fs/his/service/IFsDoctorPrescribeCommonService.java

@@ -0,0 +1,43 @@
+package com.fs.his.service;
+
+import com.fs.his.domain.FsDoctorPrescribeCommon;
+import com.fs.his.param.FsDoctorPrescribeCommonQueryParam;
+import com.github.pagehelper.PageInfo;
+
+import java.util.List;
+
+/**
+ * 医生常用语Service接口
+ */
+public interface IFsDoctorPrescribeCommonService {
+
+    /**
+     * 分页查询常用语列表
+     */
+    PageInfo<FsDoctorPrescribeCommon> getList(FsDoctorPrescribeCommonQueryParam query);
+
+    /**
+     * 根据ID查询
+     */
+    FsDoctorPrescribeCommon getById(Long commonId);
+
+    /**
+     * 新增
+     */
+    int save(FsDoctorPrescribeCommon common);
+
+    /**
+     * 修改
+     */
+    int update(FsDoctorPrescribeCommon common);
+
+    /**
+     * 删除(单条)
+     */
+    int removeById(Long commonId);
+
+    /**
+     * 批量删除
+     */
+    int removeByIds(Long[] commonIds);
+}

+ 57 - 0
fs-service/src/main/java/com/fs/his/service/impl/FsDoctorPrescribeCommonServiceImpl.java

@@ -0,0 +1,57 @@
+package com.fs.his.service.impl;
+
+
+import com.fs.common.utils.DateUtils;
+import com.fs.his.domain.FsDoctorPrescribeCommon;
+import com.fs.his.mapper.FsDoctorPrescribeCommonMapper;
+import com.fs.his.param.FsDoctorPrescribeCommonQueryParam;
+import com.fs.his.service.IFsDoctorPrescribeCommonService;
+import com.github.pagehelper.PageHelper;
+import com.github.pagehelper.PageInfo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+/**
+ * 医生常用语Service业务层处理
+ */
+@Service
+public class FsDoctorPrescribeCommonServiceImpl implements IFsDoctorPrescribeCommonService {
+
+    @Autowired
+    private FsDoctorPrescribeCommonMapper fsDoctorPrescribeCommonMapper;
+
+    @Override
+    public PageInfo<FsDoctorPrescribeCommon> getList(FsDoctorPrescribeCommonQueryParam query) {
+        PageHelper.startPage(query.getPageNum(), query.getPageSize());
+        List<FsDoctorPrescribeCommon> list = fsDoctorPrescribeCommonMapper.selectFsDoctorPrescribeCommonList(query);
+        return new PageInfo<>(list);
+    }
+
+    @Override
+    public FsDoctorPrescribeCommon getById(Long commonId) {
+        return fsDoctorPrescribeCommonMapper.selectFsDoctorPrescribeCommonById(commonId);
+    }
+
+    @Override
+    public int save(FsDoctorPrescribeCommon common) {
+        common.setCreateTime(DateUtils.getNowDate());
+        return fsDoctorPrescribeCommonMapper.insertFsDoctorPrescribeCommon(common);
+    }
+
+    @Override
+    public int update(FsDoctorPrescribeCommon common) {
+        return fsDoctorPrescribeCommonMapper.updateFsDoctorPrescribeCommon(common);
+    }
+
+    @Override
+    public int removeById(Long commonId) {
+        return fsDoctorPrescribeCommonMapper.deleteFsDoctorPrescribeCommonById(commonId);
+    }
+
+    @Override
+    public int removeByIds(Long[] commonIds) {
+        return fsDoctorPrescribeCommonMapper.deleteFsDoctorPrescribeCommonByIds(commonIds);
+    }
+}

+ 91 - 0
fs-service/src/main/resources/mapper/his/FsDoctorPrescribeCommonMapper.xml

@@ -0,0 +1,91 @@
+<?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.FsDoctorPrescribeCommonMapper">
+
+    <resultMap type="FsDoctorPrescribeCommon" id="FsDoctorPrescribeCommonResult">
+        <result property="commonId" column="common_id"/>
+        <result property="commonType" column="common_type"/>
+        <result property="textContent" column="text_content"/>
+        <result property="doctorId" column="doctor_id"/>
+        <result property="createTime" column="create_time"/>
+    </resultMap>
+
+    <!-- 条件拼接 -->
+    <sql id="selectCommon_where">
+        <where>
+            <if test="query.commonType != null">
+                AND common_type = #{query.commonType}
+            </if>
+            <if test="query.textContent != null and query.textContent != ''">
+                AND text_content LIKE CONCAT('%', #{query.textContent}, '%')
+            </if>
+        </where>
+    </sql>
+
+    <!-- 查询列表 -->
+    <select id="selectFsDoctorPrescribeCommonList" parameterType="com.fs.his.param.FsDoctorPrescribeCommonQueryParam"
+            resultMap="FsDoctorPrescribeCommonResult">
+        SELECT
+        common_id,
+        common_type,
+        text_content,
+        doctor_id,
+        create_time
+        FROM fs_doctor_prescribe_common
+        <include refid="selectCommon_where"/>
+        ORDER BY create_time DESC
+    </select>
+
+    <!-- 根据ID查询 -->
+    <select id="selectFsDoctorPrescribeCommonById" parameterType="Long" resultMap="FsDoctorPrescribeCommonResult">
+        SELECT
+            common_id,
+            common_type,
+            text_content,
+            doctor_id,
+            create_time
+        FROM fs_doctor_prescribe_common
+        WHERE common_id = #{commonId}
+    </select>
+
+    <!-- 新增 -->
+    <insert id="insertFsDoctorPrescribeCommon" parameterType="FsDoctorPrescribeCommon" useGeneratedKeys="true" keyProperty="commonId">
+        INSERT INTO fs_doctor_prescribe_common (
+            common_type,
+            text_content,
+            doctor_id,
+            create_time
+        ) VALUES (
+                     #{commonType},
+                     #{textContent},
+                     #{doctorId},
+                     #{createTime}
+                 )
+    </insert>
+
+    <!-- 修改 -->
+    <update id="updateFsDoctorPrescribeCommon" parameterType="FsDoctorPrescribeCommon">
+        UPDATE fs_doctor_prescribe_common
+        <set>
+            <if test="commonType != null">common_type = #{commonType},</if>
+            <if test="textContent != null">text_content = #{textContent},</if>
+        </set>
+        WHERE common_id = #{commonId}
+    </update>
+
+    <!-- 删除 -->
+    <delete id="deleteFsDoctorPrescribeCommonById" parameterType="Long">
+        DELETE FROM fs_doctor_prescribe_common WHERE common_id = #{commonId}
+    </delete>
+
+    <!-- 批量删除 -->
+    <delete id="deleteFsDoctorPrescribeCommonByIds" parameterType="Long[]">
+        DELETE FROM fs_doctor_prescribe_common WHERE common_id IN
+        <foreach item="commonId" collection="array" open="(" separator="," close=")">
+            #{commonId}
+        </foreach>
+    </delete>
+
+</mapper>