Ciallo 9 месяцев назад
Родитель
Сommit
b5d4d64d55

+ 82 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/controller/PatientController.java

@@ -0,0 +1,82 @@
+package com.ruoyi.web.work.controller;
+
+import java.util.Arrays;
+import java.util.List;
+
+import com.ruoyi.common.annotation.Anonymous;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+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.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.web.work.domain.Patient;
+import com.ruoyi.web.work.service.IPatientService;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 患者
+ * @author lsw
+ * @date 2024-07-19
+ */
+@Api(tags = "患者信息管理")
+@Anonymous
+@RestController
+@RequestMapping("/work/patient")
+public class PatientController extends BaseController {
+    @Autowired
+    private IPatientService patientService;
+
+    @ApiOperation(value = "获取患者信息列表")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:patient:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(Patient patient){
+        startPage();
+        List<Patient> list = patientService.selectList(patient);
+        return getDataTable(list);
+    }
+
+    @ApiOperation(value = "根据id查询信息")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:patient:query')")
+    @GetMapping(value = "/detail/{id}")
+    public AjaxResult detail(@PathVariable("id") Long id){
+        return AjaxResult.success(patientService.getById(id));
+    }
+
+    @ApiOperation(value = "添加患者信息")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:patient:add')")
+    @Log(title = "患者", businessType = BusinessType.INSERT)
+    @PostMapping("/add")
+    public AjaxResult add(@RequestBody Patient patient){
+        return toAjax(patientService.save(patient));
+    }
+
+    @ApiOperation(value = "修改患者信息")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:patient:edit')")
+    @Log(title = "患者", businessType = BusinessType.UPDATE)
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody Patient patient){
+        return toAjax(patientService.updateById(patient));
+    }
+
+    @ApiOperation(value = "删除患者信息")
+    @Anonymous
+    //@PreAuthorize("@ss.hasPermi('work:patient:remove')")
+    @Log(title = "患者", businessType = BusinessType.DELETE)
+    @GetMapping("/remove/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids){
+        return toAjax(patientService.removeByIds(Arrays.asList(ids)));
+    }
+}

+ 116 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/domain/Patient.java

@@ -0,0 +1,116 @@
+package com.ruoyi.web.work.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.FieldFill;
+import com.baomidou.mybatisplus.annotation.TableField;
+import lombok.Data;
+import com.baomidou.mybatisplus.annotation.TableName;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.experimental.Accessors;
+/**
+ * @author lmx
+ * @date 2024-07-22
+ */
+@Data
+@TableName(value = "tb_patient")
+@Accessors(chain = true)
+public class Patient{
+    private static final long serialVersionUID = 1L;
+
+    private Long id;
+
+    @ApiModelProperty(value = "卫宁患者ID")
+    private String patId;
+
+    @ApiModelProperty(value = "患者标识符")
+    private String patientCode;
+
+    @ApiModelProperty(value = "患者姓名")
+    private String name;
+
+    @ApiModelProperty(value = "出生时间")
+    private String birthDate;
+
+    @ApiModelProperty(value = "性别")
+    private String sex;
+
+    @ApiModelProperty(value = "患者地址")
+    private String address;
+
+    @ApiModelProperty(value = "电话")
+    private String phone;
+
+    @ApiModelProperty(value = "工作电话")
+    private String workPhone;
+
+    @ApiModelProperty(value = "婚姻状况")
+    private String marital;
+
+    @ApiModelProperty(value = "民族")
+    private String nation;
+
+    @ApiModelProperty(value = "职业")
+    private String career;
+
+    @ApiModelProperty(value = "国籍")
+    private String nationality;
+
+    @ApiModelProperty(value = "事件触发时间")
+    private String eventTime;
+
+    @ApiModelProperty(value = "住院业务类型:(1入院登记 2入区登记 3转区接收(出A区后入B区) 4转科转床接收(同科室换床) 5出区 6出区召回 7出院 8取消出院 9新生儿登记 10修改病人信息 门诊业务类型: 1患者建卡 2修改病人信息 3门诊挂号 4取消挂号 5就诊结束)")
+    private String eventType;
+
+    @ApiModelProperty(value = "病历号")
+    private String blh;
+
+    @ApiModelProperty(value = "病人卡号")
+    private String brkh;
+
+    @ApiModelProperty(value = "身份证号")
+    private String sfzh;
+
+    @ApiModelProperty(value = "婴儿序号")
+    private String yexh;
+
+    @ApiModelProperty(value = "卡标志")
+    private String cardSign;
+
+    @ApiModelProperty(value = "卡类别")
+    private String cardClass;
+
+    @ApiModelProperty(value = "卡号记录状况")
+    private String cardRecord;
+
+    @ApiModelProperty(value = "卡号类型")
+    private String cardType;
+
+    @ApiModelProperty(value = "就诊卡号")
+    private String cardNumber;
+
+    @ApiModelProperty(value = "创建人")
+    @TableField(fill = FieldFill.INSERT)
+    private String createBy;
+
+
+    @ApiModelProperty(value = "创建时间")
+    @TableField(fill = FieldFill.INSERT)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date createTime;
+
+    @ApiModelProperty(value = "更新人")
+    @TableField(fill = FieldFill.UPDATE)
+    private String updateBy;
+
+
+    @ApiModelProperty(value = "更新时间")
+    @TableField(fill = FieldFill.UPDATE)
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
+    private Date updateTime;
+
+    @ApiModelProperty(value = "消息体主表ID")
+    private String msgId;
+
+
+}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/mapper/PatientMapper.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.mapper;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Patient;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+
+/**
+ * @author lsw
+ * @date 2024-07-19
+ */
+public interface PatientMapper extends BaseMapper<Patient> {
+    List<Patient> selectList(Patient patient);
+}

+ 13 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/IPatientService.java

@@ -0,0 +1,13 @@
+package com.ruoyi.web.work.service;
+
+import java.util.List;
+import com.ruoyi.web.work.domain.Patient;
+import com.baomidou.mybatisplus.extension.service.IService;
+
+/**
+ * @author lsw
+ * @date 2024-07-19
+ */
+public interface IPatientService extends IService<Patient>{
+    List<Patient> selectList(Patient patient);
+}

+ 24 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/work/service/impl/PatientServiceImpl.java

@@ -0,0 +1,24 @@
+package com.ruoyi.web.work.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.ruoyi.web.work.mapper.PatientMapper;
+import com.ruoyi.web.work.domain.Patient;
+import com.ruoyi.web.work.service.IPatientService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+
+/**
+ * @author lsw
+ * @date 2024-07-19
+ */
+@Service
+public class PatientServiceImpl extends ServiceImpl<PatientMapper, Patient> implements IPatientService {
+    @Autowired
+    private PatientMapper patientMapper;
+
+    @Override
+    public List<Patient> selectList(Patient patient) {
+        return patientMapper.selectList(patient);
+    }
+}

+ 2 - 2
ruoyi-admin/src/main/resources/application-druid.yml

@@ -6,9 +6,9 @@ spring:
         druid:
             # 主库数据源
             master:
-                url: jdbc:mysql://localhost:3306/hospital?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
+                url: jdbc:mysql://123.60.57.26:3306/hospital?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                 username: root
-                password: 123456
+                password: gogo-2636616
             # 从库数据源
             slave:
                 # 从数据源开关/默认关闭

+ 37 - 0
ruoyi-admin/src/main/resources/mapper/work/PatientMapper.xml

@@ -0,0 +1,37 @@
+<?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.ruoyi.web.work.mapper.PatientMapper">
+    
+    <select id="selectList" resultType="com.ruoyi.web.work.domain.Patient">
+        select * from tb_patient
+        <where>  
+            <if test="patId != null  and patId != ''"> and pat_id = #{patId}</if>
+            <if test="patientCode != null  and patientCode != ''"> and patient_code = #{patientCode}</if>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="birthDate != null  and birthDate != ''"> and birth_date = #{birthDate}</if>
+            <if test="sex != null  and sex != ''"> and sex = #{sex}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="phone != null  and phone != ''"> and phone = #{phone}</if>
+            <if test="workPhone != null  and workPhone != ''"> and work_phone = #{workPhone}</if>
+            <if test="marital != null  and marital != ''"> and marital = #{marital}</if>
+            <if test="nation != null  and nation != ''"> and nation = #{nation}</if>
+            <if test="career != null  and career != ''"> and career = #{career}</if>
+            <if test="nationality != null  and nationality != ''"> and nationality = #{nationality}</if>
+            <if test="eventTime != null  and eventTime != ''"> and event_time = #{eventTime}</if>
+            <if test="eventType != null  and eventType != ''"> and event_type = #{eventType}</if>
+            <if test="blh != null  and blh != ''"> and blh = #{blh}</if>
+            <if test="brkh != null  and brkh != ''"> and brkh = #{brkh}</if>
+            <if test="sfzh != null  and sfzh != ''"> and sfzh = #{sfzh}</if>
+            <if test="yexh != null  and yexh != ''"> and yexh = #{yexh}</if>
+            <if test="cardSign != null  and cardSign != ''"> and card_sign = #{cardSign}</if>
+            <if test="cardClass != null  and cardClass != ''"> and card_class = #{cardClass}</if>
+            <if test="cardRecord != null  and cardRecord != ''"> and card_record = #{cardRecord}</if>
+            <if test="cardType != null  and cardType != ''"> and card_type = #{cardType}</if>
+            <if test="cardNumber != null  and cardNumber != ''"> and card_number = #{cardNumber}</if>
+            <if test="msgId != null  and msgId != ''"> and msg_id = #{msgId}</if>
+        </where>
+    </select>
+
+</mapper>