Browse Source

更新同步代码

whszxyjhyy
zhangye 2 weeks ago
parent
commit
3c223d7bd0
  1. 10
      ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java
  2. 14
      ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java
  3. 18
      ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml
  4. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java
  5. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java
  6. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java
  7. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java
  8. 22
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java
  9. 140
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java
  10. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java
  11. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java
  12. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java
  13. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java
  14. 22
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java
  15. 140
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java
  16. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java
  17. 70
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java
  18. 9
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java
  19. 572
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java
  20. 28
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml
  21. 25
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml
  22. 80
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml
  23. 26
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml
  24. 29
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml
  25. 110
      ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml
  26. 25
      ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml
  27. 8
      ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml
  28. 9
      ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml
  29. 65
      ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java
  30. 5
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  31. 32
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  32. 327
      sql/数据对接.sql

10
ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java

@ -74,6 +74,8 @@ public class SysDept extends BaseEntity {
*/
private String parentName;
private String deptCode;
/**
* 子部门
*/
@ -181,6 +183,14 @@ public class SysDept extends BaseEntity {
this.children = children;
}
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)

14
ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java

@ -68,6 +68,12 @@ public class SysUser extends BaseEntity {
@ExcelTable(name = "登录名称")
private String userName;
/**
* 工号
*/
@ExcelTable(name = "工号")
private String emplCode;
/**
* 用户昵称
*/
@ -296,6 +302,14 @@ public class SysUser extends BaseEntity {
this.userName = userName;
}
public String getEmplCode() {
return emplCode;
}
public void setEmplCode(String emplCode) {
this.emplCode = emplCode;
}
@Email(message = "邮箱格式不正确")
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
public String getEmail() {

18
ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml

@ -22,7 +22,7 @@
<jdbcConnection driverClass="com.mysql.cj.jdbc.Driver"
connectionURL="jdbc:mysql://localhost:3306/ruisi_cga_yf1?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8&amp;tinyInt1isBit=false"
userId="root"
password="q7510327">
password="123456">
<!--仅仅查询当前库的表,不查询其他库-->
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
@ -60,7 +60,7 @@
<!-- <table tableName="ums_device" domainObjectName="UmsDevice"/>-->
<!-- <table tableName="ums_data_source" domainObjectName="UmsDataSource"/>-->
<!-- <table tableName="pms_patient" domainObjectName="PmsPatient"/>-->
<table tableName="pms_patient" domainObjectName="PmsPatient"/>
<!-- <table tableName="ld_patient_record" domainObjectName="LdPatientRecord"/>-->
<!-- <table tableName="pms_patient_record" domainObjectName="PmsPatientRecord"/>-->
<!-- <table tableName="pms_patient_acp" domainObjectName="PmsPatientAcp"/>-->
@ -70,13 +70,13 @@
<!-- <table tableName="pms_patient_parent_illness" domainObjectName="PmsPatientParentIllness"/>-->
<!-- <table tableName="pms_patient_personal" domainObjectName="PmsPatientPersonal"/>-->
<!-- <table tableName="pms_patient_diagnosis" domainObjectName="PmsPatientDiagnosis"/>-->
<!-- <table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>-->
<!-- <table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>-->
<!-- <table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>-->
<!-- <table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>-->
<!-- <table tableName="dock_empl" domainObjectName="DockEmpl"/>-->
<!-- <table tableName="dock_dept" domainObjectName="DockDept"/>-->
<table tableName="dms_running_log" domainObjectName="DmsRunningLog"/>
<table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>
<table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>
<table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>
<table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>
<table tableName="dock_empl" domainObjectName="DockEmpl"/>
<table tableName="dock_dept" domainObjectName="DockDept"/>
<!-- <table tableName="dms_running_log" domainObjectName="DmsRunningLog"/>-->
<!-- <table tableName="hms_combo" domainObjectName="HmsCombo"/>-->
<!-- <table tableName="hms_combo_scale_relevance" domainObjectName="HmsComboScaleRelevance"/>-->
<!-- <table tableName="hms_doctor" domainObjectName="HmsDoctor"/>-->

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java

@ -20,6 +20,8 @@ public class DockDept implements Serializable {
private Date updateTime;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -86,6 +88,14 @@ public class DockDept implements Serializable {
this.updateTime = updateTime;
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -100,6 +110,7 @@ public class DockDept implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java

@ -634,6 +634,76 @@ public class DockDeptExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java

@ -24,6 +24,8 @@ public class DockEmpl implements Serializable {
private Date updateTime;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -106,6 +108,14 @@ public class DockEmpl implements Serializable {
this.updateTime = updateTime;
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -122,6 +132,7 @@ public class DockEmpl implements Serializable {
sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java

@ -774,6 +774,76 @@ public class DockEmplExample {
addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

22
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java

@ -8,6 +8,8 @@ public class DockPatientBaseInfo implements Serializable {
private String name;
private String patientNo;
private String idCard;
private String phone;
@ -56,6 +58,8 @@ public class DockPatientBaseInfo implements Serializable {
private String remark;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -74,6 +78,14 @@ public class DockPatientBaseInfo implements Serializable {
this.name = name == null ? null : name.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
public String getIdCard() {
return idCard;
}
@ -266,6 +278,14 @@ public class DockPatientBaseInfo implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -274,6 +294,7 @@ public class DockPatientBaseInfo implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", name=").append(name);
sb.append(", patientNo=").append(patientNo);
sb.append(", idCard=").append(idCard);
sb.append(", phone=").append(phone);
sb.append(", sex=").append(sex);
@ -298,6 +319,7 @@ public class DockPatientBaseInfo implements Serializable {
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

140
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java

@ -262,6 +262,76 @@ public class DockPatientBaseInfoExample {
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andIdCardIsNull() {
addCriterion("id_card is null");
return (Criteria) this;
@ -1901,6 +1971,76 @@ public class DockPatientBaseInfoExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java

@ -30,6 +30,8 @@ public class DockPatientDiagnosis implements Serializable {
private String remark;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -136,6 +138,14 @@ public class DockPatientDiagnosis implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -155,6 +165,7 @@ public class DockPatientDiagnosis implements Serializable {
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java

@ -981,6 +981,76 @@ public class DockPatientDiagnosisExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java

@ -29,6 +29,8 @@ public class DockPatientMedicationInfo implements Serializable {
private String remark;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -127,6 +129,14 @@ public class DockPatientMedicationInfo implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -145,6 +155,7 @@ public class DockPatientMedicationInfo implements Serializable {
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java

@ -895,6 +895,76 @@ public class DockPatientMedicationInfoExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

22
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java

@ -9,6 +9,8 @@ public class DockPatientVisitInfo implements Serializable {
private String idCard;
private String patientNo;
private String visitType;
private String visitNo;
@ -91,6 +93,8 @@ public class DockPatientVisitInfo implements Serializable {
private String remark;
private String sync;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -109,6 +113,14 @@ public class DockPatientVisitInfo implements Serializable {
this.idCard = idCard == null ? null : idCard.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
public String getVisitType() {
return visitType;
}
@ -437,6 +449,14 @@ public class DockPatientVisitInfo implements Serializable {
this.remark = remark == null ? null : remark.trim();
}
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -445,6 +465,7 @@ public class DockPatientVisitInfo implements Serializable {
sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id);
sb.append(", idCard=").append(idCard);
sb.append(", patientNo=").append(patientNo);
sb.append(", visitType=").append(visitType);
sb.append(", visitNo=").append(visitNo);
sb.append(", age=").append(age);
@ -486,6 +507,7 @@ public class DockPatientVisitInfo implements Serializable {
sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]");
return sb.toString();
}

140
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java

@ -236,6 +236,76 @@ public class DockPatientVisitInfoExample {
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andVisitTypeIsNull() {
addCriterion("visit_type is null");
return (Criteria) this;
@ -2805,6 +2875,76 @@ public class DockPatientVisitInfoExample {
addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this;
}
public Criteria andSyncIsNull() {
addCriterion("sync is null");
return (Criteria) this;
}
public Criteria andSyncIsNotNull() {
addCriterion("sync is not null");
return (Criteria) this;
}
public Criteria andSyncEqualTo(String value) {
addCriterion("sync =", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotEqualTo(String value) {
addCriterion("sync <>", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThan(String value) {
addCriterion("sync >", value, "sync");
return (Criteria) this;
}
public Criteria andSyncGreaterThanOrEqualTo(String value) {
addCriterion("sync >=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThan(String value) {
addCriterion("sync <", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLessThanOrEqualTo(String value) {
addCriterion("sync <=", value, "sync");
return (Criteria) this;
}
public Criteria andSyncLike(String value) {
addCriterion("sync like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncNotLike(String value) {
addCriterion("sync not like", value, "sync");
return (Criteria) this;
}
public Criteria andSyncIn(List<String> values) {
addCriterion("sync in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncNotIn(List<String> values) {
addCriterion("sync not in", values, "sync");
return (Criteria) this;
}
public Criteria andSyncBetween(String value1, String value2) {
addCriterion("sync between", value1, value2, "sync");
return (Criteria) this;
}
public Criteria andSyncNotBetween(String value1, String value2) {
addCriterion("sync not between", value1, value2, "sync");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

11
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java

@ -96,6 +96,8 @@ public class PmsPatient implements Serializable {
private String rhBloodType;
private String patientNo;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -466,6 +468,14 @@ public class PmsPatient implements Serializable {
this.rhBloodType = rhBloodType == null ? null : rhBloodType.trim();
}
public String getPatientNo() {
return patientNo;
}
public void setPatientNo(String patientNo) {
this.patientNo = patientNo == null ? null : patientNo.trim();
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -518,6 +528,7 @@ public class PmsPatient implements Serializable {
sb.append(", idCardTypeOther=").append(idCardTypeOther);
sb.append(", aboBloodType=").append(aboBloodType);
sb.append(", rhBloodType=").append(rhBloodType);
sb.append(", patientNo=").append(patientNo);
sb.append("]");
return sb.toString();
}

70
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java

@ -3154,6 +3154,76 @@ public class PmsPatientExample {
addCriterion("rh_blood_type not between", value1, value2, "rhBloodType");
return (Criteria) this;
}
public Criteria andPatientNoIsNull() {
addCriterion("patient_no is null");
return (Criteria) this;
}
public Criteria andPatientNoIsNotNull() {
addCriterion("patient_no is not null");
return (Criteria) this;
}
public Criteria andPatientNoEqualTo(String value) {
addCriterion("patient_no =", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotEqualTo(String value) {
addCriterion("patient_no <>", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThan(String value) {
addCriterion("patient_no >", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoGreaterThanOrEqualTo(String value) {
addCriterion("patient_no >=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThan(String value) {
addCriterion("patient_no <", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLessThanOrEqualTo(String value) {
addCriterion("patient_no <=", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoLike(String value) {
addCriterion("patient_no like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotLike(String value) {
addCriterion("patient_no not like", value, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoIn(List<String> values) {
addCriterion("patient_no in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotIn(List<String> values) {
addCriterion("patient_no not in", values, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoBetween(String value1, String value2) {
addCriterion("patient_no between", value1, value2, "patientNo");
return (Criteria) this;
}
public Criteria andPatientNoNotBetween(String value1, String value2) {
addCriterion("patient_no not between", value1, value2, "patientNo");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

9
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java

@ -1,8 +1,11 @@
package com.ccsens.system.service;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.system.domain.dto.DockDto;
import java.util.Date;
import java.util.List;
/**
* @Author zzc
@ -23,4 +26,10 @@ public interface DockService {
*/
void pulling(Date startTime, Date endTime);
void syncHospitalData();
List<SysDept> syncUmsDeptSlave();
void syncUmsDeptMaster(List<SysDept> sysDepts);
List<SysUser> syncUmsUserSlave();
void syncUmsUserMaster(List<SysUser> sysUsers);
}

572
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java

@ -2,25 +2,39 @@ package com.ccsens.system.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.pinyin.PinyinUtil;
import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.constant.ErrorConstant;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.common.enums.DataSourceType;
import com.ccsens.common.exception.base.BaseException;
import com.ccsens.common.utils.DateUtils;
import com.ccsens.common.utils.SecurityUtils;
import com.ccsens.common.utils.StringUtils;
import com.ccsens.system.domain.SysUserRole;
import com.ccsens.system.domain.dto.DockDto;
import com.ccsens.system.domain.po.*;
import com.ccsens.system.persist.dao.DockDao;
import com.ccsens.system.persist.mapper.*;
import com.ccsens.system.service.DmsDataValueService;
import com.ccsens.system.service.DockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
* @Author zzc
@ -28,8 +42,8 @@ import java.util.List;
* @Date 2026/2/9 14:55
* @description:
*/
@Slf4j
@Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class DockServiceImpl implements DockService {
@Resource
@ -57,8 +71,20 @@ public class DockServiceImpl implements DockService {
private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper;
@Resource
private PmsPatientParentIllnessMapper pmsPatientParentIllnessMapper;
@Resource
private SysDeptMapper sysDeptMapper;
@Resource
private SysUserMapper sysUserMapper;
@Resource
private SysUserRoleMapper userRoleMapper;
@Value("${hospitalId:}")
private Long hospitalId;
@Value("${generalPassword:}")
private String generalPassword;
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public Integer addDockPatient(DockDto.AddPatientDto dto) {
DockDto.PatientInfo patientInfo = dto.getBasicInfo();
@ -115,6 +141,7 @@ public class DockServiceImpl implements DockService {
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void addDept(DockDto.DockDeptInfo dto) {
DockDept dockDept = BeanUtil.copyProperties(dto, DockDept.class);
dockDeptMapper.insertSelective(dockDept);
@ -127,6 +154,7 @@ public class DockServiceImpl implements DockService {
}
@Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void pulling(Date startTime, Date endTime) {
//1.判断是否有处于processing状态的操作日志
if (dmsDataValueService.isProcessing()) {
@ -249,4 +277,546 @@ public class DockServiceImpl implements DockService {
}
}
}
public void syncHospitalData() {
//患者信息
try {
syncPmsPatient();
} catch (Exception e) {
log.error("患者信息同步失败", e);
}
//就诊信息
try {
syncPmsPatientVisitInfo();
} catch (Exception e) {
log.error("就诊信息同步失败", e);
}
//诊断信息
try {
syncPmsPatientDiagnosis();
} catch (Exception e) {
log.error("诊断信息同步失败", e);
}
//用药信息
try {
syncPmsPatientParentIllness();
} catch (Exception e) {
log.error("用药信息同步失败", e);
}
}
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncUmsUserMaster(List<SysUser> sysUsers) {
if (CollUtil.isNotEmpty(sysUsers)) {
for (SysUser sysUser : sysUsers) {
//根据code查找用户
SysUser user = new SysUser();
user.setEmplCode(sysUser.getEmplCode());
List<SysUser> users = sysUserMapper.selectUserList(user);
if (CollUtil.isEmpty(users)) {
sysUser.setDeptId(hospitalId);
sysUserMapper.insertUser(sysUser);
}
}
}
}
// @DataSource(value = DataSourceType.SLAVE)
// @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public List<SysUser> syncUmsUserSlave() {
List<SysUser> returnUsers = new ArrayList<>();
DockEmplExample dockEmplExample = new DockEmplExample();
dockEmplExample.createCriteria().andSyncEqualTo("0").andDelFlagEqualTo("0");
List<DockEmpl> dockEmpls = dockEmplMapper.selectByExample(dockEmplExample);
if (CollUtil.isEmpty(dockEmpls)) {
return returnUsers;
}
for (DockEmpl dockEmpl : dockEmpls) {
//根据code查找部门信息
SysDept sysDept = new SysDept();
sysDept.setDeptCode(dockEmpl.getDeptCode());
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isEmpty(sysDepts)) {
continue;
} else {
sysDept = sysDepts.get(0);
}
SysUser sysUser = new SysUser();
sysUser.setEmplCode(dockEmpl.getEmplCode());
List<SysUser> sysUsers = sysUserMapper.selectUserList(sysUser);
if (CollUtil.isEmpty(sysUsers)) {
sysUser.setDeptId(sysDept.getDeptId());
sysUser.setUserName("u_" + dockEmpl.getEmplCode());
sysUser.setNickName(dockEmpl.getEmplName());
sysUser.setEmplCode(dockEmpl.getEmplCode());
sysUser.setPassword(SecurityUtils.encryptPassword(generalPassword));
//获取一年后的日期
sysUser.setValidDate(DateUtil.offset(new Date(), DateField.YEAR, 1));
sysUserMapper.insertUser(sysUser);
// 新增用户与角色管理
SysUserRole ur = new SysUserRole();
ur.setUserId(sysUser.getUserId());
ur.setRoleId(104L);
userRoleMapper.batchUserRole(CollUtil.newArrayList(ur));
returnUsers.add(sysUser);
dockEmpl.setSync("1");
dockEmplMapper.updateByPrimaryKeySelective(dockEmpl);
}
}
return returnUsers;
}
// @DataSource(value = DataSourceType.SLAVE)
// @Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public List<SysDept> syncUmsDeptSlave() {
List<SysDept> returnDepts = new ArrayList<>();
//查找同步表中的部门信息
DockDeptExample dockDeptExample = new DockDeptExample();
dockDeptExample.createCriteria().andSyncEqualTo("0").andDelFlagEqualTo("0");
List<DockDept> dockDepts = dockDeptMapper.selectByExample(dockDeptExample);
if (CollUtil.isEmpty(dockDepts)) {
return returnDepts;
}
for (DockDept dockDept : dockDepts) {
//根据code查找系统的部门信息
SysDept sysDept = new SysDept();
sysDept.setDeptCode(dockDept.getDeptCode());
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isEmpty(sysDepts)) {
sysDept.setParentId(hospitalId);
sysDept.setAncestors("0," + hospitalId);
sysDept.setDeptName(dockDept.getDeptName());
sysDept.setDeptCode(dockDept.getDeptCode());
sysDeptMapper.insertDept(sysDept);
returnDepts.add(sysDept);
} else {
sysDept = sysDepts.get(0);
sysDept.setParentId(hospitalId);
sysDept.setAncestors("0," + hospitalId);
sysDept.setDeptName(dockDept.getDeptName());
sysDept.setDeptCode(dockDept.getDeptCode());
sysDeptMapper.updateDept(sysDept);
returnDepts.add(sysDept);
}
dockDept.setSync("1");
dockDeptMapper.updateByPrimaryKeySelective(dockDept);
}
return returnDepts;
}
@DataSource(value = DataSourceType.MASTER)
@Transactional(propagation = Propagation.REQUIRES_NEW, rollbackFor = Exception.class)
public void syncUmsDeptMaster(List<SysDept> sysDepts) {
if (CollUtil.isNotEmpty(sysDepts)) {
sysDepts.forEach(sysDept -> {
//根据code查找系统的部门信息
SysDept dept = new SysDept();
dept.setDeptCode(sysDept.getDeptCode());
List<SysDept> depts = sysDeptMapper.selectDeptList(dept);
if (CollUtil.isEmpty(depts)) {
sysDeptMapper.insertDept(sysDept);
} else {
SysDept sysDept1 = depts.get(0);
sysDept.setDeptId(sysDept1.getDeptId());
sysDeptMapper.updateDept(sysDept);
}
});
}
}
private void syncPmsPatient() {
DockPatientBaseInfoExample dockPatientBaseInfoExample = new DockPatientBaseInfoExample();
dockPatientBaseInfoExample.createCriteria().andSyncEqualTo("0").andDelFlagEqualTo((byte) 0);
List<DockPatientBaseInfo> dockPatientBaseInfos = dockPatientBaseInfoMapper.selectByExample(dockPatientBaseInfoExample);
if (CollUtil.isEmpty(dockPatientBaseInfos)) {
return;
}
for (DockPatientBaseInfo dockPatientBaseInfo : dockPatientBaseInfos) {
if (ObjectUtil.isNull(dockPatientBaseInfo.getPatientNo())) {
continue;
}
//根据患者患者唯一编号查询业务表内患者信息
PmsPatient pmsPatient;
PmsPatientExample pmsPatientExample = new PmsPatientExample();
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientBaseInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<PmsPatient> pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample);
if (CollUtil.isNotEmpty(pmsPatients)) {
//存在就更新
pmsPatient = pmsPatients.get(0);
disposePmsPatient(dockPatientBaseInfo, pmsPatient);
pmsPatientMapper.updateByPrimaryKeySelective(pmsPatient);
} else {
//不存在则插入
pmsPatient = new PmsPatient();
pmsPatient.setId(IdUtil.getSnowflake().nextId());
disposePmsPatient(dockPatientBaseInfo, pmsPatient);
pmsPatientMapper.insertSelective(pmsPatient);
}
//修改同步表数据的状态
dockPatientBaseInfo.setSync("1");
dockPatientBaseInfoMapper.updateByPrimaryKeySelective(dockPatientBaseInfo);
}
}
private void syncPmsPatientVisitInfo() {
//查询同步表内的就诊信息表
DockPatientVisitInfoExample dockPatientVisitInfoExample = new DockPatientVisitInfoExample();
dockPatientVisitInfoExample.createCriteria().andSyncEqualTo("0");
List<DockPatientVisitInfo> dockPatientVisitInfos = dockPatientVisitInfoMapper.selectByExample(dockPatientVisitInfoExample);
if (CollUtil.isEmpty(dockPatientVisitInfos)) {
return;
}
for (DockPatientVisitInfo dockPatientVisitInfo : dockPatientVisitInfos) {
savePatientBady(dockPatientVisitInfo);
//修改同步表数据的状态
dockPatientVisitInfo.setSync("1");
dockPatientVisitInfoMapper.updateByPrimaryKeySelective(dockPatientVisitInfo);
}
}
private PmsPatientBody savePatientBady(DockPatientVisitInfo dockPatientVisitInfo) {
//根据患者唯一编号查找业务表内患者信息
PmsPatient pmsPatient;
PmsPatientExample pmsPatientExample = new PmsPatientExample();
pmsPatientExample.createCriteria().andIdcardEqualTo(dockPatientVisitInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<PmsPatient> pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample);
if (CollUtil.isEmpty(pmsPatients)) {
//根据患者唯一编号查找同步表的患者信息
DockPatientBaseInfoExample dockPatientBaseInfoExample = new DockPatientBaseInfoExample();
dockPatientBaseInfoExample.createCriteria().andIdCardEqualTo(dockPatientVisitInfo.getPatientNo()).andDelFlagEqualTo((byte) 0);
List<DockPatientBaseInfo> dockPatientBaseInfos = dockPatientBaseInfoMapper.selectByExample(dockPatientBaseInfoExample);
if (CollUtil.isNotEmpty(dockPatientBaseInfos)) {
//存在则更新
pmsPatient = new PmsPatient();
pmsPatient.setId(IdUtil.getSnowflake().nextId());
disposePmsPatient(dockPatientBaseInfos.get(0), pmsPatient);
pmsPatientMapper.insertSelective(pmsPatient);
} else {
//不存在表示患者确实不存在,直接跳过这个就诊信息
return null;
}
} else {
pmsPatient = pmsPatients.get(0);
}
//根据就诊流水号查询业务表内患者就诊信息
PmsPatientBody pmsPatientBody;
PmsPatientBodyExample pmsPatientBodyExample = new PmsPatientBodyExample();
pmsPatientBodyExample.createCriteria().andOutpatientNoEqualTo(dockPatientVisitInfo.getVisitNo()).andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(pmsPatientBodyExample);
if (CollUtil.isNotEmpty(pmsPatientBodies)) {
pmsPatientBody = pmsPatientBodies.get(0);
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
} else {
pmsPatientBody = new PmsPatientBody();
pmsPatientBody.setId(IdUtil.getSnowflake().nextId());
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBodyMapper.insertSelective(pmsPatientBody);
}
return pmsPatientBody;
}
private void syncPmsPatientDiagnosis() {
//查找同步表的诊断信息
DockPatientDiagnosisExample dockPatientDiagnosisExample = new DockPatientDiagnosisExample();
dockPatientDiagnosisExample.createCriteria().andSyncEqualTo("0");
List<DockPatientDiagnosis> dockPatientDiagnosiss = dockPatientDiagnosisMapper.selectByExample(dockPatientDiagnosisExample);
if (CollUtil.isEmpty(dockPatientDiagnosiss)) {
return;
}
//将诊断数据根据就诊流水号进行分组
Map<String, List<DockPatientDiagnosis>> dockPatientDiagnosisMap = dockPatientDiagnosiss.stream().collect(Collectors.groupingBy(DockPatientDiagnosis::getVisitNo));
for (String key : dockPatientDiagnosisMap.keySet()) {
//根据就诊流水号查找业务表内患者就诊信息
PmsPatientBody pmsPatientBody;
PmsPatientBodyExample pmsPatientBodyExample = new PmsPatientBodyExample();
pmsPatientBodyExample.createCriteria().andOutpatientNoEqualTo(key).andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(pmsPatientBodyExample);
if (CollUtil.isNotEmpty(pmsPatientBodies)) {
pmsPatientBody = pmsPatientBodies.get(0);
} else {
//不存在则查找同步表的就诊信息
DockPatientVisitInfoExample dockPatientVisitInfoExample = new DockPatientVisitInfoExample();
dockPatientVisitInfoExample.createCriteria().andVisitNoEqualTo(key).andDelFlagEqualTo((byte) 0);
List<DockPatientVisitInfo> dockPatientVisitInfos = dockPatientVisitInfoMapper.selectByExample(dockPatientVisitInfoExample);
if (CollUtil.isNotEmpty(dockPatientVisitInfos)) {
pmsPatientBody = savePatientBady(dockPatientVisitInfos.get(0));
if (pmsPatientBody == null) {
continue;
}
} else {
//不存在则跳过
continue;
}
}
//根据流水号删除业务表内的旧数据
PmsPatientDiagnosisExample pmsPatientDiagnosisExample = new PmsPatientDiagnosisExample();
pmsPatientDiagnosisExample.createCriteria().andVisitNoEqualTo(key);
pmsPatientDiagnosisMapper.deleteByExample(pmsPatientDiagnosisExample);
for (DockPatientDiagnosis dockPatientDiagnosis : dockPatientDiagnosisMap.get(key)) {
//添加业务表
PmsPatientDiagnosis pmsPatientDiagnosis = new PmsPatientDiagnosis();
pmsPatientDiagnosis.setId(IdUtil.getSnowflake().nextId());
pmsPatientDiagnosis.setPatientId(pmsPatientBody.getPatientId());
pmsPatientDiagnosis.setVisitNo(dockPatientDiagnosis.getVisitNo());
pmsPatientDiagnosis.setDiagnosisType(dockPatientDiagnosis.getDiagnosisType());
pmsPatientDiagnosis.setIsMainDiagnosis(dockPatientDiagnosis.getIsMainDiagnosis().toString());
pmsPatientDiagnosis.setDiagnosisCode(dockPatientDiagnosis.getDiagnosisCode());
pmsPatientDiagnosis.setDiagnosisName(dockPatientDiagnosis.getDiagnosisName());
pmsPatientDiagnosis.setDiagnosisDate(DateUtil.format(dockPatientDiagnosis.getDiagnosisDate(), "yyyy-MM-dd HH:mm:ss"));
pmsPatientDiagnosisMapper.insertSelective(pmsPatientDiagnosis);
dockPatientDiagnosis.setSync("1");
dockPatientDiagnosisMapper.updateByPrimaryKeySelective(dockPatientDiagnosis);
}
}
}
private void syncPmsPatientParentIllness() {
//查找同步表的疾病信息
DockPatientMedicationInfoExample dockPatientMedicationInfoExample = new DockPatientMedicationInfoExample();
dockPatientMedicationInfoExample.createCriteria().andSyncEqualTo("0");
List<DockPatientMedicationInfo> dockPatientMedicationInfos = dockPatientMedicationInfoMapper.selectByExample(dockPatientMedicationInfoExample);
if (CollUtil.isEmpty(dockPatientMedicationInfos)) {
return;
}
//将疾病信息根据就诊流水号进行分组
Map<String, List<DockPatientMedicationInfo>> dockPatientMedicationInfoMap = dockPatientMedicationInfos.stream().collect(Collectors.groupingBy(DockPatientMedicationInfo::getVisitNo));
for (String key : dockPatientMedicationInfoMap.keySet()) {
//根据就诊流水号查找业务表内患者就诊信息
PmsPatientBody pmsPatientBody;
PmsPatientBodyExample pmsPatientBodyExample = new PmsPatientBodyExample();
pmsPatientBodyExample.createCriteria().andOutpatientNoEqualTo(key).andDelFlagEqualTo((byte) 0);
List<PmsPatientBody> pmsPatientBodies = pmsPatientBodyMapper.selectByExample(pmsPatientBodyExample);
if (CollUtil.isNotEmpty(pmsPatientBodies)) {
pmsPatientBody = pmsPatientBodies.get(0);
} else {
//不存在则查找同步表的就诊信息
DockPatientVisitInfoExample dockPatientVisitInfoExample = new DockPatientVisitInfoExample();
dockPatientVisitInfoExample.createCriteria().andVisitNoEqualTo(key).andDelFlagEqualTo((byte) 0);
List<DockPatientVisitInfo> dockPatientVisitInfos = dockPatientVisitInfoMapper.selectByExample(dockPatientVisitInfoExample);
if (CollUtil.isNotEmpty(dockPatientVisitInfos)) {
pmsPatientBody = savePatientBady(dockPatientVisitInfos.get(0));
if (pmsPatientBody == null) {
continue;
}
} else {
//不存在则跳过
continue;
}
}
//根据流水号删除业务表内的旧数据
PmsPatientParentIllnessExample pmsPatientParentIllnessExample = new PmsPatientParentIllnessExample();
pmsPatientParentIllnessExample.createCriteria().andVisitNoEqualTo(key);
pmsPatientParentIllnessMapper.deleteByExample(pmsPatientParentIllnessExample);
for (DockPatientMedicationInfo dockPatientMedicationInfo : dockPatientMedicationInfoMap.get(key)) {
PmsPatientParentIllness pmsPatientParentIllness = new PmsPatientParentIllness();
pmsPatientParentIllness.setId(IdUtil.getSnowflake().nextId());
pmsPatientParentIllness.setPatientId(pmsPatientBody.getPatientId());
pmsPatientParentIllness.setVisitNo(dockPatientMedicationInfo.getVisitNo());
pmsPatientParentIllness.setDrugName(dockPatientMedicationInfo.getDrugName());
pmsPatientParentIllness.setDose(dockPatientMedicationInfo.getDose().toString());
pmsPatientParentIllness.setUnit(dockPatientMedicationInfo.getUnit());
pmsPatientParentIllness.setFrequency(dockPatientMedicationInfo.getFrequency());
pmsPatientParentIllnessMapper.insertSelective(pmsPatientParentIllness);
//修改同步表数据的状态
dockPatientMedicationInfo.setSync("1");
dockPatientMedicationInfoMapper.updateByPrimaryKeySelective(dockPatientMedicationInfo);
}
}
}
private void disposePmsPatientBody(DockPatientVisitInfo dockPatientVisitInfo, PmsPatientBody pmsPatientBody) {
pmsPatientBody.setVisitType(dockPatientVisitInfo.getVisitType());
pmsPatientBody.setOutpatientNo(dockPatientVisitInfo.getVisitNo());
pmsPatientBody.setAge(dockPatientVisitInfo.getAge() != null ? String.valueOf(dockPatientVisitInfo.getAge()) : null);
pmsPatientBody.setDepartment(dockPatientVisitInfo.getDepartment());
pmsPatientBody.setDoctor(dockPatientVisitInfo.getDoctor());
// 入院信息
pmsPatientBody.setAdmissionDate(dockPatientVisitInfo.getAdmissionDate() != null ? dockPatientVisitInfo.getAdmissionDate().toString() : null);
pmsPatientBody.setAdmissionCount(dockPatientVisitInfo.getAdmissionCount() != null ? String.valueOf(dockPatientVisitInfo.getAdmissionCount()) : null);
pmsPatientBody.setAdmissionMethod(dockPatientVisitInfo.getAdmissionMethod());
pmsPatientBody.setBedNumber(dockPatientVisitInfo.getBedNumber());
pmsPatientBody.setDischargeDate(dockPatientVisitInfo.getDischargeDate() != null ? dockPatientVisitInfo.getDischargeDate().toString() : null);
pmsPatientBody.setDischargeMethod(dockPatientVisitInfo.getDischargeMethod());
// 身体指标
pmsPatientBody.setHeight(dockPatientVisitInfo.getHeight() != null ? String.valueOf(dockPatientVisitInfo.getHeight()) : null);
pmsPatientBody.setWeight(dockPatientVisitInfo.getWeight() != null ? String.valueOf(dockPatientVisitInfo.getWeight()) : null);
pmsPatientBody.setTz(dockPatientVisitInfo.getTz() != null ? String.valueOf(dockPatientVisitInfo.getTz()) : null);
pmsPatientBody.setTemperature(dockPatientVisitInfo.getTemperature() != null ? String.valueOf(dockPatientVisitInfo.getTemperature()) : null);
pmsPatientBody.setBloodPressureShrink(dockPatientVisitInfo.getBloodPressureShrink() != null ? String.valueOf(dockPatientVisitInfo.getBloodPressureShrink()) : null);
pmsPatientBody.setBloodPressureDiastole(dockPatientVisitInfo.getBloodPressureDiastole() != null ? String.valueOf(dockPatientVisitInfo.getBloodPressureDiastole()) : null);
pmsPatientBody.setPulse(dockPatientVisitInfo.getPulse() != null ? String.valueOf(dockPatientVisitInfo.getPulse()) : null);
// 化验指标
pmsPatientBody.setCreatinine(dockPatientVisitInfo.getCreatinine() != null ? String.valueOf(dockPatientVisitInfo.getCreatinine()) : null);
pmsPatientBody.setOxygenSaturation(dockPatientVisitInfo.getOxygenSaturation() != null ? String.valueOf(dockPatientVisitInfo.getOxygenSaturation()) : null);
pmsPatientBody.setAlbumin(dockPatientVisitInfo.getAlbumin() != null ? String.valueOf(dockPatientVisitInfo.getAlbumin()) : null);
pmsPatientBody.setTotalProtein(dockPatientVisitInfo.getTotalProtein() != null ? String.valueOf(dockPatientVisitInfo.getTotalProtein()) : null);
pmsPatientBody.setVitaminD3(dockPatientVisitInfo.getVitaminD3() != null ? String.valueOf(dockPatientVisitInfo.getVitaminD3()) : null);
pmsPatientBody.setHematocrit(dockPatientVisitInfo.getHematocrit() != null ? String.valueOf(dockPatientVisitInfo.getHematocrit()) : null);
pmsPatientBody.setDimer(dockPatientVisitInfo.getDimer() != null ? String.valueOf(dockPatientVisitInfo.getDimer()) : null);
}
private void disposePmsPatient(DockPatientBaseInfo dockPatientBaseInfo, PmsPatient pmsPatient) {
pmsPatient.setPatientNo(dockPatientBaseInfo.getPatientNo());
// 姓名相关
pmsPatient.setName(dockPatientBaseInfo.getName());
pmsPatient.setNameFull(PinyinUtil.getPinyin(pmsPatient.getName(), ""));
pmsPatient.setNameInitial(PinyinUtil.getFirstLetter(pmsPatient.getName(), ""));
// 证件信息
pmsPatient.setIdcard(dockPatientBaseInfo.getIdCard());
pmsPatient.setPhone(dockPatientBaseInfo.getPhone());
// 性别转换:将"男"/"女"转换为 0/1
String sex = dockPatientBaseInfo.getSex();
if ("男".equals(sex)) {
pmsPatient.setSex((byte) 0);
} else if ("女".equals(sex)) {
pmsPatient.setSex((byte) 1);
} else {
// 如果已经有数字代码,直接转换
try {
pmsPatient.setSex(Byte.parseByte(sex));
} catch (NumberFormatException e) {
pmsPatient.setSex((byte) 0); // 默认值
}
}
// 出生日期
pmsPatient.setBirthday(DateUtil.format(dockPatientBaseInfo.getBirthday(), "yyyy-MM-dd"));
// 教育程度转换
String educationalStatus = dockPatientBaseInfo.getEducationalStatus();
if ("文盲".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 1);
} else if ("小学".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 2);
} else if ("初中".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 3);
} else if ("高中".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 4);
} else if ("大学".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 5);
} else if ("大学以上".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 6);
} else if ("其他".equals(educationalStatus)) {
pmsPatient.setEducationalStatus((byte) 7);
} else {
try {
pmsPatient.setEducationalStatus(Byte.parseByte(educationalStatus));
} catch (NumberFormatException e) {
pmsPatient.setEducationalStatus((byte) 7); // 默认其他
}
}
// 职业转换
String career = dockPatientBaseInfo.getCareer();
if ("农林牧渔水利生产人员".equals(career)) {
pmsPatient.setCareer((byte) 1);
} else if ("教师".equals(career)) {
pmsPatient.setCareer((byte) 2);
} else if ("医务工作者".equals(career)) {
pmsPatient.setCareer((byte) 3);
} else if ("专业技术人员".equals(career)) {
pmsPatient.setCareer((byte) 4);
} else if ("生产、运输设备操作人员及有关人员".equals(career)) {
pmsPatient.setCareer((byte) 5);
} else if ("商业、服务业人员".equals(career)) {
pmsPatient.setCareer((byte) 6);
} else if ("国家机关、事业单位、企业负责人".equals(career)) {
pmsPatient.setCareer((byte) 7);
} else if ("国家机关、事业单位、企业办事人员和有关人员".equals(career)) {
pmsPatient.setCareer((byte) 8);
} else if ("军人".equals(career)) {
pmsPatient.setCareer((byte) 9);
} else if ("媒体、文体类工作人员".equals(career)) {
pmsPatient.setCareer((byte) 10);
} else if ("在校学生".equals(career)) {
pmsPatient.setCareer((byte) 11);
} else if ("未就业".equals(career)) {
pmsPatient.setCareer((byte) 12);
} else if ("家务".equals(career)) {
pmsPatient.setCareer((byte) 13);
} else if ("其他".equals(career)) {
pmsPatient.setCareer((byte) 14);
} else {
try {
pmsPatient.setCareer(Byte.parseByte(career));
} catch (NumberFormatException e) {
pmsPatient.setCareer(null);
}
}
// 婚姻状况转换
String maritalStatus = dockPatientBaseInfo.getMaritalStatus();
if ("未婚".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 1);
} else if ("已婚".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 2);
} else if ("离异".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 3);
} else if ("分居".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 4);
} else if ("丧偶".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 5);
} else if ("同居".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 6);
} else if ("其他".equals(maritalStatus)) {
pmsPatient.setMaritalStatus((byte) 7);
} else {
try {
pmsPatient.setMaritalStatus(Byte.parseByte(maritalStatus));
} catch (NumberFormatException e) {
pmsPatient.setMaritalStatus(null);
}
}
// 其他字段直接设置
pmsPatient.setNation(dockPatientBaseInfo.getNation());
pmsPatient.setNativePlace(dockPatientBaseInfo.getNativePlace());
pmsPatient.setAddress(dockPatientBaseInfo.getAddress());
// 居住状态转换
String dwellingState = dockPatientBaseInfo.getDwellingState();
if ("独居".equals(dwellingState)) {
pmsPatient.setDwellingState((byte) 1);
} else if ("与配偶或对象或子女".equals(dwellingState)) {
pmsPatient.setDwellingState((byte) 2);
} else if ("与亲戚或朋友居住".equals(dwellingState)) {
pmsPatient.setDwellingState((byte) 3);
} else {
try {
pmsPatient.setDwellingState(Byte.parseByte(dwellingState));
} catch (NumberFormatException e) {
pmsPatient.setDwellingState(null);
}
}
// 联系人信息
pmsPatient.setContactName(dockPatientBaseInfo.getContactName());
pmsPatient.setContactMobile(dockPatientBaseInfo.getContactMobile());
pmsPatient.setContactRelation(dockPatientBaseInfo.getContactRelation());
// 血型信息
pmsPatient.setAboBloodType(dockPatientBaseInfo.getAboBloodType());
pmsPatient.setRhBloodType(dockPatientBaseInfo.getRhBloodType());
// 其他信息
pmsPatient.setBelief(dockPatientBaseInfo.getBelief());
pmsPatient.setHobby(dockPatientBaseInfo.getHobby());
}
}

28
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml

@ -10,6 +10,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -70,7 +71,8 @@
</where>
</sql>
<sql id="Base_Column_List">
id, dept_name, dept_code, del_flag, create_by, create_time, update_by, update_time
id, dept_name, dept_code, del_flag, create_by, create_time, update_by, update_time,
sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultMap="BaseResultMap">
select
@ -105,10 +107,12 @@
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockDept">
insert into dock_dept (id, dept_name, dept_code,
del_flag, create_by, create_time,
update_by, update_time)
update_by, update_time, sync
)
values (#{id,jdbcType=BIGINT}, #{deptName,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR},
#{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP})
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{sync,jdbcType=VARCHAR}
)
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockDept">
insert into dock_dept
@ -137,6 +141,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -163,6 +170,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultType="java.lang.Long">
@ -198,6 +208,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -212,7 +225,8 @@
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -241,6 +255,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -252,7 +269,8 @@
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

25
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml

@ -12,6 +12,7 @@
<result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -73,7 +74,7 @@
</sql>
<sql id="Base_Column_List">
id, empl_name, empl_code, empl_type, dept_code, del_flag, create_by, create_time,
update_by, update_time
update_by, update_time, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultMap="BaseResultMap">
select
@ -109,11 +110,11 @@
insert into dock_empl (id, empl_name, empl_code,
empl_type, dept_code, del_flag,
create_by, create_time, update_by,
update_time)
update_time, sync)
values (#{id,jdbcType=BIGINT}, #{emplName,jdbcType=VARCHAR}, #{emplCode,jdbcType=VARCHAR},
#{emplType,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP})
#{updateTime,jdbcType=TIMESTAMP}, #{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockEmpl">
insert into dock_empl
@ -148,6 +149,9 @@
<if test="updateTime != null">
update_time,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -180,6 +184,9 @@
<if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultType="java.lang.Long">
@ -221,6 +228,9 @@
<if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -237,7 +247,8 @@
create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -272,6 +283,9 @@
<if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -285,7 +299,8 @@
create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}
update_time = #{updateTime,jdbcType=TIMESTAMP},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

80
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml

@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientBaseInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="sex" jdbcType="VARCHAR" property="sex" />
@ -28,6 +29,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -88,10 +90,10 @@
</where>
</sql>
<sql id="Base_Column_List">
id, name, id_card, phone, sex, birthday, educational_status, career, marital_status,
nation, native_place, address, dwelling_state, contact_name, contact_mobile, contact_relation,
abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time, update_by,
update_time, del_flag, remark
id, name, patient_no, id_card, phone, sex, birthday, educational_status, career,
marital_status, nation, native_place, address, dwelling_state, contact_name, contact_mobile,
contact_relation, abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time,
update_by, update_time, del_flag, remark, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultMap="BaseResultMap">
select
@ -124,24 +126,26 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info (id, name, id_card,
phone, sex, birthday,
educational_status, career, marital_status,
nation, native_place, address,
dwelling_state, contact_name, contact_mobile,
contact_relation, abo_blood_type, rh_blood_type,
belief, hobby, create_by,
create_time, update_by, update_time,
del_flag, remark)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
#{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE},
#{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR}, #{maritalStatus,jdbcType=VARCHAR},
#{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR},
#{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR}, #{rhBloodType,jdbcType=VARCHAR},
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP},
#{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR})
insert into dock_patient_base_info (id, name, patient_no,
id_card, phone, sex,
birthday, educational_status, career,
marital_status, nation, native_place,
address, dwelling_state, contact_name,
contact_mobile, contact_relation, abo_blood_type,
rh_blood_type, belief, hobby,
create_by, create_time, update_by,
update_time, del_flag, remark,
sync)
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{idCard,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{birthday,jdbcType=DATE}, #{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR},
#{maritalStatus,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR},
#{address,jdbcType=VARCHAR}, #{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{contactMobile,jdbcType=VARCHAR}, #{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{rhBloodType,jdbcType=VARCHAR}, #{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info
@ -152,6 +156,9 @@
<if test="name != null">
name,
</if>
<if test="patientNo != null">
patient_no,
</if>
<if test="idCard != null">
id_card,
</if>
@ -224,6 +231,9 @@
<if test="remark != null">
remark,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -232,6 +242,9 @@
<if test="name != null">
#{name,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
#{idCard,jdbcType=VARCHAR},
</if>
@ -304,6 +317,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultType="java.lang.Long">
@ -321,6 +337,9 @@
<if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR},
</if>
@ -393,6 +412,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -402,6 +424,7 @@
update dock_patient_base_info
set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
id_card = #{record.idCard,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR},
@ -425,7 +448,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -436,6 +460,9 @@
<if test="name != null">
name = #{name,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
@ -508,12 +535,16 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
update dock_patient_base_info
set name = #{name,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR},
@ -537,7 +568,8 @@
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

26
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml

@ -15,6 +15,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -76,7 +77,8 @@
</sql>
<sql id="Base_Column_List">
id, visit_no, diagnosis_type, is_main_diagnosis, diagnosis_name, diagnosis_code,
diagnosis_date, create_by, create_time, update_by, update_time, del_flag, remark
diagnosis_date, create_by, create_time, update_by, update_time, del_flag, remark,
sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultMap="BaseResultMap">
select
@ -113,12 +115,12 @@
is_main_diagnosis, diagnosis_name, diagnosis_code,
diagnosis_date, create_by, create_time,
update_by, update_time, del_flag,
remark)
remark, sync)
values (#{id,jdbcType=BIGINT}, #{visitNo,jdbcType=VARCHAR}, #{diagnosisType,jdbcType=VARCHAR},
#{isMainDiagnosis,jdbcType=TINYINT}, #{diagnosisName,jdbcType=VARCHAR}, #{diagnosisCode,jdbcType=VARCHAR},
#{diagnosisDate,jdbcType=DATE}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR})
#{remark,jdbcType=VARCHAR}, #{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosis">
insert into dock_patient_diagnosis
@ -162,6 +164,9 @@
<if test="remark != null">
remark,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -203,6 +208,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultType="java.lang.Long">
@ -253,6 +261,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -272,7 +283,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -316,6 +328,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -332,7 +347,8 @@
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

29
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml

@ -14,6 +14,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -75,7 +76,7 @@
</sql>
<sql id="Base_Column_List">
id, visit_no, drug_name, dose, unit, frequency, create_by, create_time, update_by,
update_time, del_flag, remark
update_time, del_flag, remark, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultMap="BaseResultMap">
select
@ -111,13 +112,13 @@
insert into dock_patient_medication_info (id, visit_no, drug_name,
dose, unit, frequency,
create_by, create_time, update_by,
update_time, del_flag, remark
)
update_time, del_flag, remark,
sync)
values (#{id,jdbcType=BIGINT}, #{visitNo,jdbcType=VARCHAR}, #{drugName,jdbcType=VARCHAR},
#{dose,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, #{frequency,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR}
)
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfo">
insert into dock_patient_medication_info
@ -158,6 +159,9 @@
<if test="remark != null">
remark,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -196,6 +200,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultType="java.lang.Long">
@ -243,6 +250,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -261,7 +271,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -302,6 +313,9 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -317,7 +331,8 @@
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

110
ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml

@ -4,6 +4,7 @@
<resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientVisitInfo">
<id column="id" jdbcType="BIGINT" property="id" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
<result column="visit_type" jdbcType="VARCHAR" property="visitType" />
<result column="visit_no" jdbcType="VARCHAR" property="visitNo" />
<result column="age" jdbcType="INTEGER" property="age" />
@ -45,6 +46,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -105,13 +107,13 @@
</where>
</sql>
<sql id="Base_Column_List">
id, id_card, visit_type, visit_no, age, department, doctor, admission_date, admission_count,
bed_number, discharge_date, admission_method, discharge_method, height, weight, tz,
temperature, blood_pressure_shrink, blood_pressure_diastole, pulse, creatinine, oxygen_saturation,
albumin, total_protein, vitamin_d3, hematocrit, dimer, smoking_history, smoking_year,
smoking_quit, smoking_quit_year, drink_history, drink_year, drink_quit, drink_quit_year,
has_allergy, allergy_drug, create_by, create_time, update_by, update_time, del_flag,
remark
id, id_card, patient_no, visit_type, visit_no, age, department, doctor, admission_date,
admission_count, bed_number, discharge_date, admission_method, discharge_method,
height, weight, tz, temperature, blood_pressure_shrink, blood_pressure_diastole,
pulse, creatinine, oxygen_saturation, albumin, total_protein, vitamin_d3, hematocrit,
dimer, smoking_history, smoking_year, smoking_quit, smoking_quit_year, drink_history,
drink_year, drink_quit, drink_quit_year, has_allergy, allergy_drug, create_by, create_time,
update_by, update_time, del_flag, remark, sync
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultMap="BaseResultMap">
select
@ -144,36 +146,38 @@
</if>
</delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info (id, id_card, visit_type,
visit_no, age, department,
doctor, admission_date, admission_count,
bed_number, discharge_date, admission_method,
discharge_method, height, weight,
tz, temperature, blood_pressure_shrink,
blood_pressure_diastole, pulse, creatinine,
oxygen_saturation, albumin, total_protein,
vitamin_d3, hematocrit, dimer,
smoking_history, smoking_year, smoking_quit,
smoking_quit_year, drink_history, drink_year,
drink_quit, drink_quit_year, has_allergy,
allergy_drug, create_by, create_time,
update_by, update_time, del_flag,
remark)
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{visitType,jdbcType=VARCHAR},
#{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR},
#{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP}, #{admissionCount,jdbcType=INTEGER},
#{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP}, #{admissionMethod,jdbcType=VARCHAR},
#{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL}, #{weight,jdbcType=DECIMAL},
#{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL}, #{bloodPressureShrink,jdbcType=INTEGER},
#{bloodPressureDiastole,jdbcType=INTEGER}, #{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL},
#{oxygenSaturation,jdbcType=DECIMAL}, #{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL},
#{vitaminD3,jdbcType=DECIMAL}, #{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL},
#{smokingHistory,jdbcType=TINYINT}, #{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER},
#{drinkQuit,jdbcType=TINYINT}, #{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT},
#{allergyDrug,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR})
insert into dock_patient_visit_info (id, id_card, patient_no,
visit_type, visit_no, age,
department, doctor, admission_date,
admission_count, bed_number, discharge_date,
admission_method, discharge_method, height,
weight, tz, temperature,
blood_pressure_shrink, blood_pressure_diastole,
pulse, creatinine, oxygen_saturation,
albumin, total_protein, vitamin_d3,
hematocrit, dimer, smoking_history,
smoking_year, smoking_quit, smoking_quit_year,
drink_history, drink_year, drink_quit,
drink_quit_year, has_allergy, allergy_drug,
create_by, create_time, update_by,
update_time, del_flag, remark,
sync)
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{visitType,jdbcType=VARCHAR}, #{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},
#{department,jdbcType=VARCHAR}, #{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP},
#{admissionCount,jdbcType=INTEGER}, #{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP},
#{admissionMethod,jdbcType=VARCHAR}, #{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL},
#{weight,jdbcType=DECIMAL}, #{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL},
#{bloodPressureShrink,jdbcType=INTEGER}, #{bloodPressureDiastole,jdbcType=INTEGER},
#{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL}, #{oxygenSaturation,jdbcType=DECIMAL},
#{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL}, #{vitaminD3,jdbcType=DECIMAL},
#{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL}, #{smokingHistory,jdbcType=TINYINT},
#{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT}, #{smokingQuitYear,jdbcType=INTEGER},
#{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER}, #{drinkQuit,jdbcType=TINYINT},
#{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT}, #{allergyDrug,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{remark,jdbcType=VARCHAR},
#{sync,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info
@ -184,6 +188,9 @@
<if test="idCard != null">
id_card,
</if>
<if test="patientNo != null">
patient_no,
</if>
<if test="visitType != null">
visit_type,
</if>
@ -307,6 +314,9 @@
<if test="remark != null">
remark,
</if>
<if test="sync != null">
sync,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -315,6 +325,9 @@
<if test="idCard != null">
#{idCard,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null">
#{visitType,jdbcType=VARCHAR},
</if>
@ -438,6 +451,9 @@
<if test="remark != null">
#{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultType="java.lang.Long">
@ -455,6 +471,9 @@
<if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.visitType != null">
visit_type = #{record.visitType,jdbcType=VARCHAR},
</if>
@ -578,6 +597,9 @@
<if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR},
</if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -587,6 +609,7 @@
update dock_patient_visit_info
set id = #{record.id,jdbcType=BIGINT},
id_card = #{record.idCard,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
visit_type = #{record.visitType,jdbcType=VARCHAR},
visit_no = #{record.visitNo,jdbcType=VARCHAR},
age = #{record.age,jdbcType=INTEGER},
@ -627,7 +650,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT},
remark = #{record.remark,jdbcType=VARCHAR}
remark = #{record.remark,jdbcType=VARCHAR},
sync = #{record.sync,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -638,6 +662,9 @@
<if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null">
visit_type = #{visitType,jdbcType=VARCHAR},
</if>
@ -761,12 +788,16 @@
<if test="remark != null">
remark = #{remark,jdbcType=VARCHAR},
</if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
update dock_patient_visit_info
set id_card = #{idCard,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
visit_type = #{visitType,jdbcType=VARCHAR},
visit_no = #{visitNo,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER},
@ -807,7 +838,8 @@
update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR}
remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

25
ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml

@ -48,6 +48,7 @@
<result column="id_card_type_other" jdbcType="VARCHAR" property="idCardTypeOther" />
<result column="abo_blood_type" jdbcType="VARCHAR" property="aboBloodType" />
<result column="rh_blood_type" jdbcType="VARCHAR" property="rhBloodType" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -114,7 +115,7 @@
city, address, domicile, independent_living_skills, dwelling_state, recorder, remark,
create_by, create_time, update_by, update_time, del_flag, birth_year, birthday, belief,
hobby, contact_name, contact_relation, contact_mobile, contact_other, id_card_type,
id_card_type_other, abo_blood_type, rh_blood_type
id_card_type_other, abo_blood_type, rh_blood_type, patient_no
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultMap="BaseResultMap">
select
@ -162,7 +163,7 @@
belief, hobby, contact_name,
contact_relation, contact_mobile, contact_other,
id_card_type, id_card_type_other, abo_blood_type,
rh_blood_type)
rh_blood_type, patient_no)
values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{nameInitial,jdbcType=VARCHAR}, #{nameFull,jdbcType=VARCHAR},
#{patientNumber,jdbcType=VARCHAR}, #{hospitalNumber,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},
@ -178,7 +179,7 @@
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{contactOther,jdbcType=VARCHAR},
#{idCardType,jdbcType=VARCHAR}, #{idCardTypeOther,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{rhBloodType,jdbcType=VARCHAR})
#{rhBloodType,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.PmsPatient">
insert into pms_patient
@ -321,6 +322,9 @@
<if test="rhBloodType != null">
rh_blood_type,
</if>
<if test="patientNo != null">
patient_no,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -461,6 +465,9 @@
<if test="rhBloodType != null">
#{rhBloodType,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultType="java.lang.Long">
@ -610,6 +617,9 @@
<if test="record.rhBloodType != null">
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR},
</if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -662,7 +672,8 @@
id_card_type = #{record.idCardType,jdbcType=VARCHAR},
id_card_type_other = #{record.idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{record.aboBloodType,jdbcType=VARCHAR},
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR}
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -805,6 +816,9 @@
<if test="rhBloodType != null">
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR},
</if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -854,7 +868,8 @@
id_card_type = #{idCardType,jdbcType=VARCHAR},
id_card_type_other = #{idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{aboBloodType,jdbcType=VARCHAR},
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR}
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

8
ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml

@ -42,6 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="status != null and status != ''">
AND status = #{status}
</if>
<if test="deptCode != null and deptCode != ''">
AND dept_code = #{deptCode}
</if>
<!-- 数据范围过滤 -->
${params.dataScope}
order by d.parent_id, d.order_num
@ -87,11 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select>
<insert id="insertDept" parameterType="SysDept">
<insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
insert into ums_dept(
<if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</if>
<if test="deptCode != null and deptCode != ''">dept_code,</if>
<if test="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null">order_num,</if>
<if test="leader != null and leader != ''">leader,</if>
@ -104,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="deptId != null and deptId != 0">#{deptId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</if>
<if test="deptCode != null and deptCode != ''">#{deptCode},</if>
<if test="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if>
@ -120,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</if>
<if test="deptCode != null and deptCode != ''">dept_code = #{deptCode},</if>
<if test="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</if>

9
ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml

@ -104,6 +104,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%')
</if>
<if test="emplCode != null and emplCode != ''">
AND u.empl_code = #{emplCode}
</if>
<if test="status != null and status != ''">
AND u.status = #{status}
</if>
@ -160,8 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0'
group by u.user_id
where (u.user_name = #{userName} or u.empl_code = #{userName}) and u.del_flag = '0'
group by u.user_id limit 1
</select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult">
@ -234,6 +237,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="postId != null and postId != 0">post_id,</if>
<if test="titleId != null and titleId != 0">title_id,</if>
<if test="userName != null and userName != ''">user_name,</if>
<if test="emplCode != null and emplCode != ''">empl_code,</if>
<if test="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</if>
@ -252,6 +256,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="postId != null and postId != ''">#{postId},</if>
<if test="titleId != null and titleId != ''">#{titleId},</if>
<if test="userName != null and userName != ''">#{userName},</if>
<if test="emplCode != null and emplCode != ''">#{emplCode},</if>
<if test="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</if>

65
ruisi_java/ruisi-web-client/src/main/java/com/ccsens/client/controller/scheduled/SyncHospitalData.java

@ -0,0 +1,65 @@
package com.ccsens.client.controller.scheduled;
import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.core.domain.entity.SysDept;
import com.ccsens.common.core.domain.entity.SysUser;
import com.ccsens.common.enums.DataSourceType;
import com.ccsens.system.service.DockService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.util.List;
/**
* @author zy
* @date 2026/2/28 16:30
*/
@Slf4j
@Component
public class SyncHospitalData {
@Resource
private DockService dockService;
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "0 */2 * * * ?")
public void syncHospitalData() {
dockService.syncHospitalData();
}
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "*/30 * * * * ?")
public void syncDeptData() {
try {
List<SysDept> sysDepts = dockService.syncUmsDeptSlave();
syncDeptMaster(sysDepts);
}catch (Exception e){
log.error("部门信息同步失败",e);
}
}
@DataSource(value = DataSourceType.MASTER)
public void syncDeptMaster(List<SysDept> sysDepts) {
dockService.syncUmsDeptMaster(sysDepts);
}
@DataSource(value = DataSourceType.SLAVE)
@Scheduled(cron = "*/30 * * * * ?")
public void syncUserData() {
try {
List<SysUser> sysUsers = dockService.syncUmsUserSlave();
syncUserMaster(sysUsers);
}catch (Exception e){
log.error("用户信息同步失败",e);
}
}
@DataSource(value = DataSourceType.MASTER)
public void syncUserMaster(List<SysUser> sysUser) {
dockService.syncUmsUserMaster(sysUser);
}
}

5
ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml

@ -124,3 +124,8 @@ informed:
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 178
generalPassword: cga123#

32
ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml

@ -12,10 +12,10 @@ spring:
# 从库数据源
slave:
# 从数据源开关/默认关闭
enabled: false
url:
username:
password:
enabled: true
url: jdbc:mysql://172.16.21.24:23306/ruisi_cga_hnszyyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: root
password: xian#2024!!!
# 初始连接数
initialSize: 5
# 最小连接池数量
@ -62,13 +62,13 @@ spring:
# redis 配置
redis:
# 地址
host: localhost
host: 172.16.21.24
# 端口,默认为6379
port: 6379
port: 26379
# 数据库索引
database: 1
# 密码
password: 123456
password: redis111^#
# 连接超时时间
timeout: 10s
lettuce:
@ -81,6 +81,20 @@ spring:
max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms
# 核心:SpringBoot全局UTF-8编码配置
server:
# 配置Tomcat容器UTF-8编码(关键,解决URI中文解码)
tomcat:
uri-encoding: UTF-8 # 强制Tomcat对URI进行UTF-8解码
relaxed-path-chars: [ '%', '#', '&', '=', '|', ',', ';', '\\', ' ', '中' ] # 允许路径包含中文/特殊符号
# 全局请求/响应编码
servlet:
encoding:
enabled: true # 开启编码自动配置
charset: UTF-8 # 编码格式
force: true # 强制所有请求/响应使用UTF-8(覆盖容器默认编码)
force-request: true # 强制请求编码为UTF-8
force-response: true # 强制响应编码为UTF-8
app:
# 是否开启调式模式
@ -115,3 +129,7 @@ informed:
#clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0
clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 178
generalPassword: cga123#

327
sql/数据对接.sql

@ -1,150 +1,209 @@
DROP TABLE IF EXISTS `dock_dept`;
CREATE TABLE `dock_dept` (
`id` bigint(20) NOT NULL COMMENT '表ID',
`dept_name` varchar(255) NOT NULL COMMENT '科室名称',
`dept_code` varchar(255) NOT NULL COMMENT '编码',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`dept_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '科室名称',
`dept_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '编码',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '更新时间',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='三方部门表';
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '三方部门表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Table structure for dock_empl
-- ----------------------------
DROP TABLE IF EXISTS `dock_empl`;
CREATE TABLE `dock_empl` (
`id` bigint(20) NOT NULL COMMENT '表ID',
`empl_name` varchar(255) NOT NULL COMMENT '姓名',
`empl_code` varchar(255) NOT NULL COMMENT '工号或者账号',
`empl_type` varchar(255) NOT NULL COMMENT '医生或者护士身份判断标识',
`dept_code` varchar(255) NOT NULL COMMENT '所属科室编码',
`del_flag` char(1) DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
`create_by` varchar(64) DEFAULT '' COMMENT '创建者',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`empl_name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
`empl_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '工号或者账号',
`empl_type` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '医生或者护士身份判断标识',
`dept_code` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '所属科室编码',
`del_flag` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '0' COMMENT '删除标志(0代表存在 2代表删除)',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '创建者',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT '创建时间',
`update_by` varchar(64) DEFAULT '' COMMENT '更新者',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE current_timestamp() COMMENT '更新时间',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '' COMMENT '更新者',
`update_time` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '更新时间',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci ROW_FORMAT=DYNAMIC COMMENT='三方员工表';
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '三方员工表' ROW_FORMAT = DYNAMIC;
-- ----------------------------
-- Records of dock_empl
-- ----------------------------
-- ----------------------------
-- Table structure for dock_patient_base_info
-- ----------------------------
DROP TABLE IF EXISTS `dock_patient_base_info`;
CREATE TABLE `dock_patient_base_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`name` varchar(100) NOT NULL COMMENT '姓名',
`id_card` varchar(50) NOT NULL COMMENT '证件号码(身份证号)',
`phone` varchar(20) NOT NULL COMMENT '联系电话',
`sex` varchar(10) DEFAULT NULL COMMENT '性别:0女、1男',
`birthday` date DEFAULT NULL COMMENT '出生日期',
`educational_status` varchar(50) NOT NULL COMMENT '受教育程度:0文盲、1小学、2初中、3高中/技校/中专、4大学/专科及以上',
`career` varchar(100) DEFAULT NULL COMMENT '职业类型:1:农林牧渔水利生产人员 2:教师 3:医务工作者 4:专业技术人员 5:生产、运输设备操作人员及有关人员6:商业、服务业人员7:国家机关、事业单位、企业负责人8:国家机关、事业单位、企业办事人员和有关人员9:军人 10:媒体、文体类工作人员 11:在校学生 12:未就业 13:家务 14:其他',
`marital_status` varchar(20) DEFAULT NULL COMMENT '婚姻状况:0已婚、1未婚、2离婚、3丧偶、4未知',
`nation` varchar(50) DEFAULT NULL COMMENT '民族',
`native_place` varchar(200) DEFAULT NULL COMMENT '籍贯',
`address` varchar(500) DEFAULT NULL COMMENT '现住址',
`dwelling_state` varchar(50) DEFAULT NULL COMMENT '居住状态:0独居、1夫妻同住、2多代加入同住、3养老院、4其他',
`contact_name` varchar(100) DEFAULT NULL COMMENT '联系人姓名',
`contact_mobile` varchar(20) DEFAULT NULL COMMENT '联系人电话',
`contact_relation` varchar(50) DEFAULT NULL COMMENT '与联系人关系',
`abo_blood_type` varchar(10) DEFAULT NULL COMMENT 'ABO血型',
`rh_blood_type` varchar(10) DEFAULT NULL COMMENT 'Rh血型',
`belief` varchar(100) DEFAULT NULL COMMENT '信仰',
`hobby` varchar(500) DEFAULT NULL COMMENT '爱好',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者的用户名',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '姓名',
`patient_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '患者唯一编号',
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号码(身份证号)',
`phone` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '联系电话',
`sex` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '性别:0女、1男',
`birthday` date NULL DEFAULT NULL COMMENT '出生日期',
`educational_status` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '受教育程度:0文盲、1小学、2初中、3高中/技校/中专、4大学/专科及以上',
`career` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '职业类型:1:农林牧渔水利生产人员 2:教师 3:医务工作者 4:专业技术人员 5:生产、运输设备操作人员及有关人员6:商业、服务业人员7:国家机关、事业单位、企业负责人8:国家机关、事业单位、企业办事人员和有关人员9:军人 10:媒体、文体类工作人员 11:在校学生 12:未就业 13:家务 14:其他',
`marital_status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '婚姻状况:0已婚、1未婚、2离婚、3丧偶、4未知',
`nation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '民族',
`native_place` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '籍贯',
`address` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '现住址',
`dwelling_state` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '居住状态:0独居、1夫妻同住、2多代加入同住、3养老院、4其他',
`contact_name` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人姓名',
`contact_mobile` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '联系人电话',
`contact_relation` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '与联系人关系',
`abo_blood_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'ABO血型',
`rh_blood_type` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT 'Rh血型',
`belief` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '信仰',
`hobby` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '爱好',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者的用户名',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT ' 创建时间 ',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT ' 修改时间 ',
`del_flag` tinyint(4) DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_id_card` (`id_card`),
KEY `idx_phone` (`phone`)
) ENGINE=InnoDB AUTO_INCREMENT=19 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='患者基础信息表';
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP COMMENT ' 修改时间 ',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_id_card`(`id_card` ASC) USING BTREE,
INDEX `idx_phone`(`phone` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 19 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '患者基础信息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for dock_patient_diagnosis
-- ----------------------------
DROP TABLE IF EXISTS `dock_patient_diagnosis`;
CREATE TABLE `dock_patient_diagnosis` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`visit_no` varchar(100) NOT NULL COMMENT '就诊流水号,关联就诊信息表的就诊号',
`diagnosis_type` varchar(50) DEFAULT NULL COMMENT '诊断类型(如门诊诊断、出院诊断)',
`is_main_diagnosis` tinyint(1) DEFAULT NULL COMMENT '是否主要诊断:0=否,1=是',
`diagnosis_name` varchar(500) DEFAULT NULL COMMENT '诊断名称(如高血压2级)',
`diagnosis_code` varchar(50) DEFAULT NULL COMMENT '诊断编码(如ICD-10编码)',
`diagnosis_date` date DEFAULT NULL COMMENT '诊断日期',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者的用户名',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`visit_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '就诊流水号,关联就诊信息表的就诊号',
`diagnosis_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '诊断类型(如门诊诊断、出院诊断)',
`is_main_diagnosis` tinyint(1) NULL DEFAULT NULL COMMENT '是否主要诊断:0=否,1=是',
`diagnosis_name` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '诊断名称(如高血压2级)',
`diagnosis_code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '诊断编码(如ICD-10编码)',
`diagnosis_date` date NULL DEFAULT NULL COMMENT '诊断日期',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者的用户名',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT ' 创建时间 ',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT ' 修改时间 ',
`del_flag` tinyint(4) DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
KEY `idx_diagnosis_visit_no` (`visit_no`),
KEY `idx_diagnosis_code` (`diagnosis_code`)
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='患者诊断信息表';
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP COMMENT ' 修改时间 ',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_diagnosis_visit_no`(`visit_no` ASC) USING BTREE,
INDEX `idx_diagnosis_code`(`diagnosis_code` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '患者诊断信息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for dock_patient_medication_info
-- ----------------------------
DROP TABLE IF EXISTS `dock_patient_medication_info`;
CREATE TABLE `dock_patient_medication_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`visit_no` varchar(100) NOT NULL COMMENT '门诊/住院号,关联就诊信息表的就诊号',
`drug_name` varchar(200) DEFAULT NULL COMMENT '药物名称',
`dose` decimal(10,2) DEFAULT NULL COMMENT '剂量',
`unit` varchar(20) DEFAULT NULL COMMENT '单位(如mg、ml、片)',
`frequency` varchar(100) DEFAULT NULL COMMENT '用药频率(如每日3次、每8小时1次)',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者的用户名',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`visit_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门诊/住院号,关联就诊信息表的就诊号',
`drug_name` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '药物名称',
`dose` decimal(10, 2) NULL DEFAULT NULL COMMENT '剂量',
`unit` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '单位(如mg、ml、片)',
`frequency` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '用药频率(如每日3次、每8小时1次)',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者的用户名',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT ' 创建时间 ',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT ' 修改时间 ',
`del_flag` tinyint(4) DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
KEY `idx_med_visit_no` (`visit_no`),
KEY `idx_drug_name` (`drug_name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='患者用药信息表';
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP COMMENT ' 修改时间 ',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE,
INDEX `idx_med_visit_no`(`visit_no` ASC) USING BTREE,
INDEX `idx_drug_name`(`drug_name` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '患者用药信息表' ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for dock_patient_visit_info
-- ----------------------------
DROP TABLE IF EXISTS `dock_patient_visit_info`;
CREATE TABLE `dock_patient_visit_info` (
`id` bigint(20) NOT NULL AUTO_INCREMENT COMMENT '自增主键',
`id_card` varchar(50) NOT NULL COMMENT '证件号码,使用身份证号与基础信息关联',
`visit_type` varchar(50) NOT NULL COMMENT '就诊类型',
`visit_no` varchar(100) NOT NULL COMMENT '门诊/住院号',
`age` int(11) DEFAULT NULL COMMENT '年龄',
`department` varchar(100) DEFAULT NULL COMMENT '就诊/住院科室',
`doctor` varchar(100) DEFAULT NULL COMMENT '就诊/主治医师',
`admission_date` datetime DEFAULT NULL COMMENT '就诊/入院日期',
`admission_count` int(11) DEFAULT NULL COMMENT '住院次数',
`bed_number` varchar(50) DEFAULT NULL COMMENT '床位号',
`discharge_date` datetime DEFAULT NULL COMMENT '出院日期',
`admission_method` varchar(100) DEFAULT NULL COMMENT '入院途径',
`discharge_method` varchar(100) DEFAULT NULL COMMENT '离院方式',
`height` decimal(5,2) DEFAULT NULL COMMENT '身高,单位:厘米',
`weight` decimal(5,2) DEFAULT NULL COMMENT '体重,单位:千克',
`tz` decimal(5,2) DEFAULT NULL COMMENT 'T值',
`temperature` decimal(4,2) DEFAULT NULL COMMENT '体温,单位:摄氏度',
`blood_pressure_shrink` int(11) DEFAULT NULL COMMENT '收缩压',
`blood_pressure_diastole` int(11) DEFAULT NULL COMMENT '舒张压',
`pulse` int(11) DEFAULT NULL COMMENT '脉搏',
`creatinine` decimal(6,2) DEFAULT NULL COMMENT '肌酐',
`oxygen_saturation` decimal(5,2) DEFAULT NULL COMMENT '血氧饱和度',
`albumin` decimal(5,2) DEFAULT NULL COMMENT '白蛋白',
`total_protein` decimal(5,2) DEFAULT NULL COMMENT '总蛋白',
`vitamin_d3` decimal(5,2) DEFAULT NULL COMMENT '维生素D3测定',
`hematocrit` decimal(5,2) DEFAULT NULL COMMENT '凝血酶原时间',
`dimer` decimal(6,2) DEFAULT NULL COMMENT 'D-二聚体',
`smoking_history` tinyint(1) DEFAULT NULL COMMENT '是否吸烟,0=否,1=是',
`smoking_year` int(11) DEFAULT NULL COMMENT '吸烟年限',
`smoking_quit` tinyint(1) DEFAULT NULL COMMENT '是否戒烟,0=否,1=是',
`smoking_quit_year` int(11) DEFAULT NULL COMMENT '戒烟年限',
`drink_history` tinyint(1) DEFAULT NULL COMMENT '是否饮酒,0=否,1=是',
`drink_year` int(11) DEFAULT NULL COMMENT '饮酒年限',
`drink_quit` tinyint(1) DEFAULT NULL COMMENT '是否戒酒,0=否,1=是',
`drink_quit_year` int(11) DEFAULT NULL COMMENT '戒酒年限',
`has_allergy` tinyint(1) DEFAULT NULL COMMENT '是否过敏,0=否,1=是',
`allergy_drug` varchar(500) DEFAULT NULL COMMENT '过敏药',
`create_by` varchar(64) DEFAULT NULL COMMENT '创建者的用户名',
`id` bigint NOT NULL AUTO_INCREMENT COMMENT '表ID(自增)',
`id_card` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '证件号码',
`patient_no` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '患者唯一编号',
`visit_type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '就诊类型',
`visit_no` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL COMMENT '门诊/住院号',
`age` int NULL DEFAULT NULL COMMENT '年龄',
`department` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '就诊/住院科室',
`doctor` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '就诊/主治医师',
`admission_date` datetime NULL DEFAULT NULL COMMENT '就诊/入院日期',
`admission_count` int NULL DEFAULT NULL COMMENT '住院次数',
`bed_number` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '床位号',
`discharge_date` datetime NULL DEFAULT NULL COMMENT '出院日期',
`admission_method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '入院途径',
`discharge_method` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '离院方式',
`height` decimal(5, 2) NULL DEFAULT NULL COMMENT '身高,单位:厘米',
`weight` decimal(5, 2) NULL DEFAULT NULL COMMENT '体重,单位:千克',
`tz` decimal(5, 2) NULL DEFAULT NULL COMMENT 'T值',
`temperature` decimal(4, 2) NULL DEFAULT NULL COMMENT '体温,单位:摄氏度',
`blood_pressure_shrink` int NULL DEFAULT NULL COMMENT '收缩压',
`blood_pressure_diastole` int NULL DEFAULT NULL COMMENT '舒张压',
`pulse` int NULL DEFAULT NULL COMMENT '脉搏',
`creatinine` decimal(6, 2) NULL DEFAULT NULL COMMENT '肌酐',
`oxygen_saturation` decimal(5, 2) NULL DEFAULT NULL COMMENT '血氧饱和度',
`albumin` decimal(5, 2) NULL DEFAULT NULL COMMENT '白蛋白',
`total_protein` decimal(5, 2) NULL DEFAULT NULL COMMENT '总蛋白',
`vitamin_d3` decimal(5, 2) NULL DEFAULT NULL COMMENT '维生素D3测定',
`hematocrit` decimal(5, 2) NULL DEFAULT NULL COMMENT '凝血酶原时间',
`dimer` decimal(6, 2) NULL DEFAULT NULL COMMENT 'D-二聚体',
`smoking_history` tinyint(1) NULL DEFAULT NULL COMMENT '是否吸烟,0=否,1=是',
`smoking_year` int NULL DEFAULT NULL COMMENT '吸烟年限',
`smoking_quit` tinyint(1) NULL DEFAULT NULL COMMENT '是否戒烟,0=否,1=是',
`smoking_quit_year` int NULL DEFAULT NULL COMMENT '戒烟年限',
`drink_history` tinyint(1) NULL DEFAULT NULL COMMENT '是否饮酒,0=否,1=是',
`drink_year` int NULL DEFAULT NULL COMMENT '饮酒年限',
`drink_quit` tinyint(1) NULL DEFAULT NULL COMMENT '是否戒酒,0=否,1=是',
`drink_quit_year` int NULL DEFAULT NULL COMMENT '戒酒年限',
`has_allergy` tinyint(1) NULL DEFAULT NULL COMMENT '是否过敏,0=否,1=是',
`allergy_drug` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '过敏药',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '创建者的用户名',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT ' 创建时间 ',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE CURRENT_TIMESTAMP COMMENT ' 修改时间 ',
`del_flag` tinyint NULL DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL COMMENT '备注',
`sync` varchar(20) NULL DEFAULT '0' COMMENT '是否同步 0否 1是',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `idx_visit_no`(`visit_no` ASC) USING BTREE,
INDEX `idx_id_card`(`id_card` ASC) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '患者就诊信息表' ROW_FORMAT = Dynamic;
-- 患者表添加字段
ALTER TABLE `pms_patient`
ADD COLUMN `patient_no` varchar(50) COMMENT '患者院内唯一编号';
-- 主库从库都需要修改部门和用户表,加字段
ALTER TABLE `ums_user`
ADD COLUMN `empl_code` varchar(30) DEFAULT '' COMMENT '工号' AFTER `nick_name`;
ALTER TABLE `ums_dept`
ADD COLUMN `dept_code` varchar(30) DEFAULT '' COMMENT '科室编码' AFTER `dept_name`;
CREATE TABLE `ems_evaluation_scale_cognitive_relevance` (
`id` bigint(20) NOT NULL,
`evaluation_id` bigint(20) DEFAULT 0 COMMENT '测评id',
`scale_code` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '' COMMENT ' 量表code ',
`parent_id` bigint(20) DEFAULT NULL COMMENT '认知域父级CODE',
`cognitive_code` varchar(20) DEFAULT '' COMMENT '认知域code',
`score` decimal(11,1) DEFAULT NULL COMMENT '得分',
`total_score` decimal(10,1) DEFAULT NULL COMMENT '总分',
`combo_id` bigint(20) DEFAULT NULL COMMENT '套餐ID',
`sort` int(11) DEFAULT 0 COMMENT ' 排序',
`create_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建者的用户名',
`create_time` timestamp NOT NULL DEFAULT current_timestamp() COMMENT ' 创建时间 ',
`update_by` varchar(64) DEFAULT NULL COMMENT '更新者的用户名',
`update_by` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '更新者的用户名',
`update_time` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT ' 修改时间 ',
`del_flag` tinyint(4) DEFAULT 0 COMMENT '记录状态 0-正常 1-删除',
`remark` varchar(500) DEFAULT NULL COMMENT '备注',
PRIMARY KEY (`id`),
UNIQUE KEY `idx_visit_no` (`visit_no`),
KEY `idx_id_card` (`id_card`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='患者就诊信息表';
`del_flag` tinyint(3) unsigned DEFAULT 0 COMMENT ' 是否删除(1:是 0:否) ',
PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci ROW_FORMAT=DYNAMIC COMMENT='测评量表认知域得分表';
/**
*/
CREATE USER 'dock'@'%' IDENTIFIED BY 'dock_123#';
GRANT ALL PRIVILEGES ON database_name.dock_dept TO 'username'@'%';
GRANT ALL PRIVILEGES ON database_name.dock_empl TO 'username'@'%';
GRANT ALL PRIVILEGES ON database_name.dock_patient_base_info TO 'username'@'%';
GRANT ALL PRIVILEGES ON database_name.dock_patient_diagnosis TO 'username'@'%';
GRANT ALL PRIVILEGES ON database_name.dock_patient_medication_info TO 'username'@'%';
GRANT ALL PRIVILEGES ON database_name.dock_patient_visit_info TO 'username'@'%';
FLUSH PRIVILEGES;
ALTER TABLE `ruisi_cga_yf1`.`ems_evaluation_scale_relevance`
ADD COLUMN `combo_id` bigint NULL AFTER `scale_code`;
Loading…
Cancel
Save