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. 576
      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. 7
      ruisi_java/ruisi-web-client/src/main/resources/application-dev.yml
  31. 34
      ruisi_java/ruisi-web-client/src/main/resources/application-prod.yml
  32. 339
      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 parentName;
private String deptCode;
/** /**
* 子部门 * 子部门
*/ */
@ -181,6 +183,14 @@ public class SysDept extends BaseEntity {
this.children = children; this.children = children;
} }
public String getDeptCode() {
return deptCode;
}
public void setDeptCode(String deptCode) {
this.deptCode = deptCode;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) 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 = "登录名称") @ExcelTable(name = "登录名称")
private String userName; private String userName;
/**
* 工号
*/
@ExcelTable(name = "工号")
private String emplCode;
/** /**
* 用户昵称 * 用户昵称
*/ */
@ -296,6 +302,14 @@ public class SysUser extends BaseEntity {
this.userName = userName; this.userName = userName;
} }
public String getEmplCode() {
return emplCode;
}
public void setEmplCode(String emplCode) {
this.emplCode = emplCode;
}
@Email(message = "邮箱格式不正确") @Email(message = "邮箱格式不正确")
@Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符")
public String getEmail() { 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" <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" connectionURL="jdbc:mysql://localhost:3306/ruisi_cga_yf1?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8&amp;tinyInt1isBit=false"
userId="root" userId="root"
password="q7510327"> password="123456">
<!--仅仅查询当前库的表,不查询其他库--> <!--仅仅查询当前库的表,不查询其他库-->
<property name="nullCatalogMeansCurrent" value="true"/> <property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection> </jdbcConnection>
@ -60,7 +60,7 @@
<!-- <table tableName="ums_device" domainObjectName="UmsDevice"/>--> <!-- <table tableName="ums_device" domainObjectName="UmsDevice"/>-->
<!-- <table tableName="ums_data_source" domainObjectName="UmsDataSource"/>--> <!-- <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="ld_patient_record" domainObjectName="LdPatientRecord"/>-->
<!-- <table tableName="pms_patient_record" domainObjectName="PmsPatientRecord"/>--> <!-- <table tableName="pms_patient_record" domainObjectName="PmsPatientRecord"/>-->
<!-- <table tableName="pms_patient_acp" domainObjectName="PmsPatientAcp"/>--> <!-- <table tableName="pms_patient_acp" domainObjectName="PmsPatientAcp"/>-->
@ -70,13 +70,13 @@
<!-- <table tableName="pms_patient_parent_illness" domainObjectName="PmsPatientParentIllness"/>--> <!-- <table tableName="pms_patient_parent_illness" domainObjectName="PmsPatientParentIllness"/>-->
<!-- <table tableName="pms_patient_personal" domainObjectName="PmsPatientPersonal"/>--> <!-- <table tableName="pms_patient_personal" domainObjectName="PmsPatientPersonal"/>-->
<!-- <table tableName="pms_patient_diagnosis" domainObjectName="PmsPatientDiagnosis"/>--> <!-- <table tableName="pms_patient_diagnosis" domainObjectName="PmsPatientDiagnosis"/>-->
<!-- <table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>--> <table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>
<!-- <table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>--> <table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>
<!-- <table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>--> <table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>
<!-- <table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>--> <table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>
<!-- <table tableName="dock_empl" domainObjectName="DockEmpl"/>--> <table tableName="dock_empl" domainObjectName="DockEmpl"/>
<!-- <table tableName="dock_dept" domainObjectName="DockDept"/>--> <table tableName="dock_dept" domainObjectName="DockDept"/>
<table tableName="dms_running_log" domainObjectName="DmsRunningLog"/> <!-- <table tableName="dms_running_log" domainObjectName="DmsRunningLog"/>-->
<!-- <table tableName="hms_combo" domainObjectName="HmsCombo"/>--> <!-- <table tableName="hms_combo" domainObjectName="HmsCombo"/>-->
<!-- <table tableName="hms_combo_scale_relevance" domainObjectName="HmsComboScaleRelevance"/>--> <!-- <table tableName="hms_combo_scale_relevance" domainObjectName="HmsComboScaleRelevance"/>-->
<!-- <table tableName="hms_doctor" domainObjectName="HmsDoctor"/>--> <!-- <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 Date updateTime;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -86,6 +88,14 @@ public class DockDept implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -100,6 +110,7 @@ public class DockDept implements Serializable {
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy); sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; 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 { 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 Date updateTime;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -106,6 +108,14 @@ public class DockEmpl implements Serializable {
this.updateTime = updateTime; this.updateTime = updateTime;
} }
public String getSync() {
return sync;
}
public void setSync(String sync) {
this.sync = sync == null ? null : sync.trim();
}
@Override @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -122,6 +132,7 @@ public class DockEmpl implements Serializable {
sb.append(", createTime=").append(createTime); sb.append(", createTime=").append(createTime);
sb.append(", updateBy=").append(updateBy); sb.append(", updateBy=").append(updateBy);
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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"); addCriterion("update_time not between", value1, value2, "updateTime");
return (Criteria) this; 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 { 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 name;
private String patientNo;
private String idCard; private String idCard;
private String phone; private String phone;
@ -56,6 +58,8 @@ public class DockPatientBaseInfo implements Serializable {
private String remark; private String remark;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -74,6 +78,14 @@ public class DockPatientBaseInfo implements Serializable {
this.name = name == null ? null : name.trim(); 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() { public String getIdCard() {
return idCard; return idCard;
} }
@ -266,6 +278,14 @@ public class DockPatientBaseInfo implements Serializable {
this.remark = remark == null ? null : remark.trim(); 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 @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -274,6 +294,7 @@ public class DockPatientBaseInfo implements Serializable {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", name=").append(name); sb.append(", name=").append(name);
sb.append(", patientNo=").append(patientNo);
sb.append(", idCard=").append(idCard); sb.append(", idCard=").append(idCard);
sb.append(", phone=").append(phone); sb.append(", phone=").append(phone);
sb.append(", sex=").append(sex); sb.append(", sex=").append(sex);
@ -298,6 +319,7 @@ public class DockPatientBaseInfo implements Serializable {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag); sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark); sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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; 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() { public Criteria andIdCardIsNull() {
addCriterion("id_card is null"); addCriterion("id_card is null");
return (Criteria) this; return (Criteria) this;
@ -1901,6 +1971,76 @@ public class DockPatientBaseInfoExample {
addCriterion("remark not between", value1, value2, "remark"); addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this; 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 { 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 remark;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -136,6 +138,14 @@ public class DockPatientDiagnosis implements Serializable {
this.remark = remark == null ? null : remark.trim(); 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 @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -155,6 +165,7 @@ public class DockPatientDiagnosis implements Serializable {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag); sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark); sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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"); addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this; 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 { 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 remark;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -127,6 +129,14 @@ public class DockPatientMedicationInfo implements Serializable {
this.remark = remark == null ? null : remark.trim(); 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 @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -145,6 +155,7 @@ public class DockPatientMedicationInfo implements Serializable {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag); sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark); sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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"); addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this; 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 { 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 idCard;
private String patientNo;
private String visitType; private String visitType;
private String visitNo; private String visitNo;
@ -91,6 +93,8 @@ public class DockPatientVisitInfo implements Serializable {
private String remark; private String remark;
private String sync;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -109,6 +113,14 @@ public class DockPatientVisitInfo implements Serializable {
this.idCard = idCard == null ? null : idCard.trim(); 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() { public String getVisitType() {
return visitType; return visitType;
} }
@ -437,6 +449,14 @@ public class DockPatientVisitInfo implements Serializable {
this.remark = remark == null ? null : remark.trim(); 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 @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -445,6 +465,7 @@ public class DockPatientVisitInfo implements Serializable {
sb.append("Hash = ").append(hashCode()); sb.append("Hash = ").append(hashCode());
sb.append(", id=").append(id); sb.append(", id=").append(id);
sb.append(", idCard=").append(idCard); sb.append(", idCard=").append(idCard);
sb.append(", patientNo=").append(patientNo);
sb.append(", visitType=").append(visitType); sb.append(", visitType=").append(visitType);
sb.append(", visitNo=").append(visitNo); sb.append(", visitNo=").append(visitNo);
sb.append(", age=").append(age); sb.append(", age=").append(age);
@ -486,6 +507,7 @@ public class DockPatientVisitInfo implements Serializable {
sb.append(", updateTime=").append(updateTime); sb.append(", updateTime=").append(updateTime);
sb.append(", delFlag=").append(delFlag); sb.append(", delFlag=").append(delFlag);
sb.append(", remark=").append(remark); sb.append(", remark=").append(remark);
sb.append(", sync=").append(sync);
sb.append("]"); sb.append("]");
return sb.toString(); 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; 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() { public Criteria andVisitTypeIsNull() {
addCriterion("visit_type is null"); addCriterion("visit_type is null");
return (Criteria) this; return (Criteria) this;
@ -2805,6 +2875,76 @@ public class DockPatientVisitInfoExample {
addCriterion("remark not between", value1, value2, "remark"); addCriterion("remark not between", value1, value2, "remark");
return (Criteria) this; 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 { 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 rhBloodType;
private String patientNo;
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
public Long getId() { public Long getId() {
@ -466,6 +468,14 @@ public class PmsPatient implements Serializable {
this.rhBloodType = rhBloodType == null ? null : rhBloodType.trim(); 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 @Override
public String toString() { public String toString() {
StringBuilder sb = new StringBuilder(); StringBuilder sb = new StringBuilder();
@ -518,6 +528,7 @@ public class PmsPatient implements Serializable {
sb.append(", idCardTypeOther=").append(idCardTypeOther); sb.append(", idCardTypeOther=").append(idCardTypeOther);
sb.append(", aboBloodType=").append(aboBloodType); sb.append(", aboBloodType=").append(aboBloodType);
sb.append(", rhBloodType=").append(rhBloodType); sb.append(", rhBloodType=").append(rhBloodType);
sb.append(", patientNo=").append(patientNo);
sb.append("]"); sb.append("]");
return sb.toString(); 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"); addCriterion("rh_blood_type not between", value1, value2, "rhBloodType");
return (Criteria) this; 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 { 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; 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 com.ccsens.system.domain.dto.DockDto;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* @Author zzc * @Author zzc
@ -23,4 +26,10 @@ public interface DockService {
*/ */
void pulling(Date startTime, Date endTime); void pulling(Date startTime, Date endTime);
void syncHospitalData();
List<SysDept> syncUmsDeptSlave();
void syncUmsDeptMaster(List<SysDept> sysDepts);
List<SysUser> syncUmsUserSlave();
void syncUmsUserMaster(List<SysUser> sysUsers);
} }

576
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.bean.BeanUtil;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.date.DateField;
import cn.hutool.core.date.DateUtil; import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import cn.hutool.extra.pinyin.PinyinUtil; import cn.hutool.extra.pinyin.PinyinUtil;
import com.ccsens.common.annotation.DataSource;
import com.ccsens.common.constant.ErrorConstant; 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.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.dto.DockDto;
import com.ccsens.system.domain.po.*; import com.ccsens.system.domain.po.*;
import com.ccsens.system.persist.dao.DockDao; import com.ccsens.system.persist.dao.DockDao;
import com.ccsens.system.persist.mapper.*; import com.ccsens.system.persist.mapper.*;
import com.ccsens.system.service.DmsDataValueService; import com.ccsens.system.service.DmsDataValueService;
import com.ccsens.system.service.DockService; 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.stereotype.Service;
import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* @Author zzc * @Author zzc
@ -28,8 +42,8 @@ import java.util.List;
* @Date 2026/2/9 14:55 * @Date 2026/2/9 14:55
* @description: * @description:
*/ */
@Slf4j
@Service @Service
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public class DockServiceImpl implements DockService { public class DockServiceImpl implements DockService {
@Resource @Resource
@ -54,11 +68,23 @@ public class DockServiceImpl implements DockService {
@Resource @Resource
private PmsPatientBodyMapper pmsPatientBodyMapper; private PmsPatientBodyMapper pmsPatientBodyMapper;
@Resource @Resource
private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper; private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper;
@Resource @Resource
private PmsPatientParentIllnessMapper pmsPatientParentIllnessMapper; 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 @Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public Integer addDockPatient(DockDto.AddPatientDto dto) { public Integer addDockPatient(DockDto.AddPatientDto dto) {
DockDto.PatientInfo patientInfo = dto.getBasicInfo(); DockDto.PatientInfo patientInfo = dto.getBasicInfo();
@ -115,6 +141,7 @@ public class DockServiceImpl implements DockService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void addDept(DockDto.DockDeptInfo dto) { public void addDept(DockDto.DockDeptInfo dto) {
DockDept dockDept = BeanUtil.copyProperties(dto, DockDept.class); DockDept dockDept = BeanUtil.copyProperties(dto, DockDept.class);
dockDeptMapper.insertSelective(dockDept); dockDeptMapper.insertSelective(dockDept);
@ -127,6 +154,7 @@ public class DockServiceImpl implements DockService {
} }
@Override @Override
@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class)
public void pulling(Date startTime, Date endTime) { public void pulling(Date startTime, Date endTime) {
//1.判断是否有处于processing状态的操作日志 //1.判断是否有处于processing状态的操作日志
if (dmsDataValueService.isProcessing()) { if (dmsDataValueService.isProcessing()) {
@ -241,7 +269,7 @@ public class DockServiceImpl implements DockService {
} }
} }
}else { } else {
//不存在新增 //不存在新增
PmsPatient pmsPatient = BeanUtil.copyProperties(dockPatientBaseInfo, PmsPatient.class); PmsPatient pmsPatient = BeanUtil.copyProperties(dockPatientBaseInfo, PmsPatient.class);
pmsPatient.setId(IdUtil.getSnowflake().nextId()); pmsPatient.setId(IdUtil.getSnowflake().nextId());
@ -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="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -70,7 +71,8 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <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> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultMap="BaseResultMap">
select select
@ -105,10 +107,12 @@
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockDept"> <insert id="insert" parameterType="com.ccsens.system.domain.po.DockDept">
insert into dock_dept (id, dept_name, dept_code, insert into dock_dept (id, dept_name, dept_code,
del_flag, create_by, create_time, 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}, values (#{id,jdbcType=BIGINT}, #{deptName,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR},
#{delFlag,jdbcType=CHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{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>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockDept"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockDept">
insert into dock_dept insert into dock_dept
@ -137,6 +141,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -163,6 +170,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockDeptExample" resultType="java.lang.Long">
@ -198,6 +208,9 @@
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -212,7 +225,8 @@
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -241,6 +255,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -252,7 +269,8 @@
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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="create_time" jdbcType="TIMESTAMP" property="createTime" />
<result column="update_by" jdbcType="VARCHAR" property="updateBy" /> <result column="update_by" jdbcType="VARCHAR" property="updateBy" />
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -73,7 +74,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, empl_name, empl_code, empl_type, dept_code, del_flag, create_by, create_time, 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> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultMap="BaseResultMap">
select select
@ -109,11 +110,11 @@
insert into dock_empl (id, empl_name, empl_code, insert into dock_empl (id, empl_name, empl_code,
empl_type, dept_code, del_flag, empl_type, dept_code, del_flag,
create_by, create_time, update_by, create_by, create_time, update_by,
update_time) update_time, sync)
values (#{id,jdbcType=BIGINT}, #{emplName,jdbcType=VARCHAR}, #{emplCode,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{emplName,jdbcType=VARCHAR}, #{emplCode,jdbcType=VARCHAR},
#{emplType,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR}, #{emplType,jdbcType=VARCHAR}, #{deptCode,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR},
#{updateTime,jdbcType=TIMESTAMP}) #{updateTime,jdbcType=TIMESTAMP}, #{sync,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockEmpl"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockEmpl">
insert into dock_empl insert into dock_empl
@ -148,6 +149,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time, update_time,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -180,6 +184,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
#{updateTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockEmplExample" resultType="java.lang.Long">
@ -221,6 +228,9 @@
<if test="record.updateTime != null"> <if test="record.updateTime != null">
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -237,7 +247,8 @@
create_by = #{record.createBy,jdbcType=VARCHAR}, create_by = #{record.createBy,jdbcType=VARCHAR},
create_time = #{record.createTime,jdbcType=TIMESTAMP}, create_time = #{record.createTime,jdbcType=TIMESTAMP},
update_by = #{record.updateBy,jdbcType=VARCHAR}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -272,6 +283,9 @@
<if test="updateTime != null"> <if test="updateTime != null">
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -285,7 +299,8 @@
create_by = #{createBy,jdbcType=VARCHAR}, create_by = #{createBy,jdbcType=VARCHAR},
create_time = #{createTime,jdbcType=TIMESTAMP}, create_time = #{createTime,jdbcType=TIMESTAMP},
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP} update_time = #{updateTime,jdbcType=TIMESTAMP},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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"> <resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientBaseInfo">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="name" jdbcType="VARCHAR" property="name" /> <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="id_card" jdbcType="VARCHAR" property="idCard" />
<result column="phone" jdbcType="VARCHAR" property="phone" /> <result column="phone" jdbcType="VARCHAR" property="phone" />
<result column="sex" jdbcType="VARCHAR" property="sex" /> <result column="sex" jdbcType="VARCHAR" property="sex" />
@ -28,6 +29,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -88,10 +90,10 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, name, id_card, phone, sex, birthday, educational_status, career, marital_status, id, name, patient_no, id_card, phone, sex, birthday, educational_status, career,
nation, native_place, address, dwelling_state, contact_name, contact_mobile, contact_relation, marital_status, nation, native_place, address, dwelling_state, contact_name, contact_mobile,
abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time, update_by, contact_relation, abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time,
update_time, del_flag, remark update_by, update_time, del_flag, remark, sync
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultMap="BaseResultMap">
select select
@ -124,24 +126,26 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo"> <insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info (id, name, id_card, insert into dock_patient_base_info (id, name, patient_no,
phone, sex, birthday, id_card, phone, sex,
educational_status, career, marital_status, birthday, educational_status, career,
nation, native_place, address, marital_status, nation, native_place,
dwelling_state, contact_name, contact_mobile, address, dwelling_state, contact_name,
contact_relation, abo_blood_type, rh_blood_type, contact_mobile, contact_relation, abo_blood_type,
belief, hobby, create_by, rh_blood_type, belief, hobby,
create_time, update_by, update_time, create_by, create_time, update_by,
del_flag, remark) update_time, del_flag, remark,
values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR}, sync)
#{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE}, values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR}, #{maritalStatus,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{sex,jdbcType=VARCHAR},
#{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{birthday,jdbcType=DATE}, #{educationalStatus,jdbcType=VARCHAR}, #{career,jdbcType=VARCHAR},
#{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{maritalStatus,jdbcType=VARCHAR}, #{nation,jdbcType=VARCHAR}, #{nativePlace,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR}, #{rhBloodType,jdbcType=VARCHAR}, #{address,jdbcType=VARCHAR}, #{dwellingState,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{contactRelation,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{createTime,jdbcType=TIMESTAMP}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{rhBloodType,jdbcType=VARCHAR}, #{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR},
#{delFlag,jdbcType=TINYINT}, #{remark,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>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
insert into dock_patient_base_info insert into dock_patient_base_info
@ -152,6 +156,9 @@
<if test="name != null"> <if test="name != null">
name, name,
</if> </if>
<if test="patientNo != null">
patient_no,
</if>
<if test="idCard != null"> <if test="idCard != null">
id_card, id_card,
</if> </if>
@ -224,6 +231,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -232,6 +242,9 @@
<if test="name != null"> <if test="name != null">
#{name,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null"> <if test="idCard != null">
#{idCard,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
</if> </if>
@ -304,6 +317,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfoExample" resultType="java.lang.Long">
@ -321,6 +337,9 @@
<if test="record.name != null"> <if test="record.name != null">
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
</if> </if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.idCard != null"> <if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR}, id_card = #{record.idCard,jdbcType=VARCHAR},
</if> </if>
@ -393,6 +412,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -402,6 +424,7 @@
update dock_patient_base_info update dock_patient_base_info
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
name = #{record.name,jdbcType=VARCHAR}, name = #{record.name,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
id_card = #{record.idCard,jdbcType=VARCHAR}, id_card = #{record.idCard,jdbcType=VARCHAR},
phone = #{record.phone,jdbcType=VARCHAR}, phone = #{record.phone,jdbcType=VARCHAR},
sex = #{record.sex,jdbcType=VARCHAR}, sex = #{record.sex,jdbcType=VARCHAR},
@ -425,7 +448,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -436,6 +460,9 @@
<if test="name != null"> <if test="name != null">
name = #{name,jdbcType=VARCHAR}, name = #{name,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="idCard != null"> <if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR}, id_card = #{idCard,jdbcType=VARCHAR},
</if> </if>
@ -508,12 +535,16 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo"> <update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientBaseInfo">
update dock_patient_base_info update dock_patient_base_info
set name = #{name,jdbcType=VARCHAR}, set name = #{name,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
id_card = #{idCard,jdbcType=VARCHAR}, id_card = #{idCard,jdbcType=VARCHAR},
phone = #{phone,jdbcType=VARCHAR}, phone = #{phone,jdbcType=VARCHAR},
sex = #{sex,jdbcType=VARCHAR}, sex = #{sex,jdbcType=VARCHAR},
@ -537,7 +568,8 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}, del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -76,7 +77,8 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, visit_no, diagnosis_type, is_main_diagnosis, diagnosis_name, diagnosis_code, 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> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultMap="BaseResultMap">
select select
@ -113,12 +115,12 @@
is_main_diagnosis, diagnosis_name, diagnosis_code, is_main_diagnosis, diagnosis_name, diagnosis_code,
diagnosis_date, create_by, create_time, diagnosis_date, create_by, create_time,
update_by, update_time, del_flag, update_by, update_time, del_flag,
remark) remark, sync)
values (#{id,jdbcType=BIGINT}, #{visitNo,jdbcType=VARCHAR}, #{diagnosisType,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{visitNo,jdbcType=VARCHAR}, #{diagnosisType,jdbcType=VARCHAR},
#{isMainDiagnosis,jdbcType=TINYINT}, #{diagnosisName,jdbcType=VARCHAR}, #{diagnosisCode,jdbcType=VARCHAR}, #{isMainDiagnosis,jdbcType=TINYINT}, #{diagnosisName,jdbcType=VARCHAR}, #{diagnosisCode,jdbcType=VARCHAR},
#{diagnosisDate,jdbcType=DATE}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{diagnosisDate,jdbcType=DATE}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT},
#{remark,jdbcType=VARCHAR}) #{remark,jdbcType=VARCHAR}, #{sync,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosis"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosis">
insert into dock_patient_diagnosis insert into dock_patient_diagnosis
@ -162,6 +164,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -203,6 +208,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientDiagnosisExample" resultType="java.lang.Long">
@ -253,6 +261,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -272,7 +283,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -316,6 +328,9 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -332,7 +347,8 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}, del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -75,7 +76,7 @@
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, visit_no, drug_name, dose, unit, frequency, create_by, create_time, update_by, 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> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultMap="BaseResultMap">
select select
@ -111,13 +112,13 @@
insert into dock_patient_medication_info (id, visit_no, drug_name, insert into dock_patient_medication_info (id, visit_no, drug_name,
dose, unit, frequency, dose, unit, frequency,
create_by, create_time, update_by, 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}, values (#{id,jdbcType=BIGINT}, #{visitNo,jdbcType=VARCHAR}, #{drugName,jdbcType=VARCHAR},
#{dose,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, #{frequency,jdbcType=VARCHAR}, #{dose,jdbcType=DECIMAL}, #{unit,jdbcType=VARCHAR}, #{frequency,jdbcType=VARCHAR},
#{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{updateBy,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>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfo"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfo">
insert into dock_patient_medication_info insert into dock_patient_medication_info
@ -158,6 +159,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -196,6 +200,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientMedicationInfoExample" resultType="java.lang.Long">
@ -243,6 +250,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -261,7 +271,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -302,6 +313,9 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -317,7 +331,8 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}, del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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"> <resultMap id="BaseResultMap" type="com.ccsens.system.domain.po.DockPatientVisitInfo">
<id column="id" jdbcType="BIGINT" property="id" /> <id column="id" jdbcType="BIGINT" property="id" />
<result column="id_card" jdbcType="VARCHAR" property="idCard" /> <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_type" jdbcType="VARCHAR" property="visitType" />
<result column="visit_no" jdbcType="VARCHAR" property="visitNo" /> <result column="visit_no" jdbcType="VARCHAR" property="visitNo" />
<result column="age" jdbcType="INTEGER" property="age" /> <result column="age" jdbcType="INTEGER" property="age" />
@ -45,6 +46,7 @@
<result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
<result column="del_flag" jdbcType="TINYINT" property="delFlag" /> <result column="del_flag" jdbcType="TINYINT" property="delFlag" />
<result column="remark" jdbcType="VARCHAR" property="remark" /> <result column="remark" jdbcType="VARCHAR" property="remark" />
<result column="sync" jdbcType="VARCHAR" property="sync" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -105,13 +107,13 @@
</where> </where>
</sql> </sql>
<sql id="Base_Column_List"> <sql id="Base_Column_List">
id, id_card, visit_type, visit_no, age, department, doctor, admission_date, admission_count, id, id_card, patient_no, visit_type, visit_no, age, department, doctor, admission_date,
bed_number, discharge_date, admission_method, discharge_method, height, weight, tz, admission_count, bed_number, discharge_date, admission_method, discharge_method,
temperature, blood_pressure_shrink, blood_pressure_diastole, pulse, creatinine, oxygen_saturation, height, weight, tz, temperature, blood_pressure_shrink, blood_pressure_diastole,
albumin, total_protein, vitamin_d3, hematocrit, dimer, smoking_history, smoking_year, pulse, creatinine, oxygen_saturation, albumin, total_protein, vitamin_d3, hematocrit,
smoking_quit, smoking_quit_year, drink_history, drink_year, drink_quit, drink_quit_year, dimer, smoking_history, smoking_year, smoking_quit, smoking_quit_year, drink_history,
has_allergy, allergy_drug, create_by, create_time, update_by, update_time, del_flag, drink_year, drink_quit, drink_quit_year, has_allergy, allergy_drug, create_by, create_time,
remark update_by, update_time, del_flag, remark, sync
</sql> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultMap="BaseResultMap">
select select
@ -144,36 +146,38 @@
</if> </if>
</delete> </delete>
<insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo"> <insert id="insert" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info (id, id_card, visit_type, insert into dock_patient_visit_info (id, id_card, patient_no,
visit_no, age, department, visit_type, visit_no, age,
doctor, admission_date, admission_count, department, doctor, admission_date,
bed_number, discharge_date, admission_method, admission_count, bed_number, discharge_date,
discharge_method, height, weight, admission_method, discharge_method, height,
tz, temperature, blood_pressure_shrink, weight, tz, temperature,
blood_pressure_diastole, pulse, creatinine, blood_pressure_shrink, blood_pressure_diastole,
oxygen_saturation, albumin, total_protein, pulse, creatinine, oxygen_saturation,
vitamin_d3, hematocrit, dimer, albumin, total_protein, vitamin_d3,
smoking_history, smoking_year, smoking_quit, hematocrit, dimer, smoking_history,
smoking_quit_year, drink_history, drink_year, smoking_year, smoking_quit, smoking_quit_year,
drink_quit, drink_quit_year, has_allergy, drink_history, drink_year, drink_quit,
allergy_drug, create_by, create_time, drink_quit_year, has_allergy, allergy_drug,
update_by, update_time, del_flag, create_by, create_time, update_by,
remark) update_time, del_flag, remark,
values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{visitType,jdbcType=VARCHAR}, sync)
#{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER}, #{department,jdbcType=VARCHAR}, values (#{id,jdbcType=BIGINT}, #{idCard,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR},
#{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP}, #{admissionCount,jdbcType=INTEGER}, #{visitType,jdbcType=VARCHAR}, #{visitNo,jdbcType=VARCHAR}, #{age,jdbcType=INTEGER},
#{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP}, #{admissionMethod,jdbcType=VARCHAR}, #{department,jdbcType=VARCHAR}, #{doctor,jdbcType=VARCHAR}, #{admissionDate,jdbcType=TIMESTAMP},
#{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL}, #{weight,jdbcType=DECIMAL}, #{admissionCount,jdbcType=INTEGER}, #{bedNumber,jdbcType=VARCHAR}, #{dischargeDate,jdbcType=TIMESTAMP},
#{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL}, #{bloodPressureShrink,jdbcType=INTEGER}, #{admissionMethod,jdbcType=VARCHAR}, #{dischargeMethod,jdbcType=VARCHAR}, #{height,jdbcType=DECIMAL},
#{bloodPressureDiastole,jdbcType=INTEGER}, #{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL}, #{weight,jdbcType=DECIMAL}, #{tz,jdbcType=DECIMAL}, #{temperature,jdbcType=DECIMAL},
#{oxygenSaturation,jdbcType=DECIMAL}, #{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL}, #{bloodPressureShrink,jdbcType=INTEGER}, #{bloodPressureDiastole,jdbcType=INTEGER},
#{vitaminD3,jdbcType=DECIMAL}, #{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL}, #{pulse,jdbcType=INTEGER}, #{creatinine,jdbcType=DECIMAL}, #{oxygenSaturation,jdbcType=DECIMAL},
#{smokingHistory,jdbcType=TINYINT}, #{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT}, #{albumin,jdbcType=DECIMAL}, #{totalProtein,jdbcType=DECIMAL}, #{vitaminD3,jdbcType=DECIMAL},
#{smokingQuitYear,jdbcType=INTEGER}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER}, #{hematocrit,jdbcType=DECIMAL}, #{dimer,jdbcType=DECIMAL}, #{smokingHistory,jdbcType=TINYINT},
#{drinkQuit,jdbcType=TINYINT}, #{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT}, #{smokingYear,jdbcType=INTEGER}, #{smokingQuit,jdbcType=TINYINT}, #{smokingQuitYear,jdbcType=INTEGER},
#{allergyDrug,jdbcType=VARCHAR}, #{createBy,jdbcType=VARCHAR}, #{createTime,jdbcType=TIMESTAMP}, #{drinkHistory,jdbcType=TINYINT}, #{drinkYear,jdbcType=INTEGER}, #{drinkQuit,jdbcType=TINYINT},
#{updateBy,jdbcType=VARCHAR}, #{updateTime,jdbcType=TIMESTAMP}, #{delFlag,jdbcType=TINYINT}, #{drinkQuitYear,jdbcType=INTEGER}, #{hasAllergy,jdbcType=TINYINT}, #{allergyDrug,jdbcType=VARCHAR},
#{remark,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>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
insert into dock_patient_visit_info insert into dock_patient_visit_info
@ -184,6 +188,9 @@
<if test="idCard != null"> <if test="idCard != null">
id_card, id_card,
</if> </if>
<if test="patientNo != null">
patient_no,
</if>
<if test="visitType != null"> <if test="visitType != null">
visit_type, visit_type,
</if> </if>
@ -307,6 +314,9 @@
<if test="remark != null"> <if test="remark != null">
remark, remark,
</if> </if>
<if test="sync != null">
sync,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -315,6 +325,9 @@
<if test="idCard != null"> <if test="idCard != null">
#{idCard,jdbcType=VARCHAR}, #{idCard,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null"> <if test="visitType != null">
#{visitType,jdbcType=VARCHAR}, #{visitType,jdbcType=VARCHAR},
</if> </if>
@ -438,6 +451,9 @@
<if test="remark != null"> <if test="remark != null">
#{remark,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
#{sync,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfoExample" resultType="java.lang.Long">
@ -455,6 +471,9 @@
<if test="record.idCard != null"> <if test="record.idCard != null">
id_card = #{record.idCard,jdbcType=VARCHAR}, id_card = #{record.idCard,jdbcType=VARCHAR},
</if> </if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
<if test="record.visitType != null"> <if test="record.visitType != null">
visit_type = #{record.visitType,jdbcType=VARCHAR}, visit_type = #{record.visitType,jdbcType=VARCHAR},
</if> </if>
@ -578,6 +597,9 @@
<if test="record.remark != null"> <if test="record.remark != null">
remark = #{record.remark,jdbcType=VARCHAR}, remark = #{record.remark,jdbcType=VARCHAR},
</if> </if>
<if test="record.sync != null">
sync = #{record.sync,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -587,6 +609,7 @@
update dock_patient_visit_info update dock_patient_visit_info
set id = #{record.id,jdbcType=BIGINT}, set id = #{record.id,jdbcType=BIGINT},
id_card = #{record.idCard,jdbcType=VARCHAR}, id_card = #{record.idCard,jdbcType=VARCHAR},
patient_no = #{record.patientNo,jdbcType=VARCHAR},
visit_type = #{record.visitType,jdbcType=VARCHAR}, visit_type = #{record.visitType,jdbcType=VARCHAR},
visit_no = #{record.visitNo,jdbcType=VARCHAR}, visit_no = #{record.visitNo,jdbcType=VARCHAR},
age = #{record.age,jdbcType=INTEGER}, age = #{record.age,jdbcType=INTEGER},
@ -627,7 +650,8 @@
update_by = #{record.updateBy,jdbcType=VARCHAR}, update_by = #{record.updateBy,jdbcType=VARCHAR},
update_time = #{record.updateTime,jdbcType=TIMESTAMP}, update_time = #{record.updateTime,jdbcType=TIMESTAMP},
del_flag = #{record.delFlag,jdbcType=TINYINT}, 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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -638,6 +662,9 @@
<if test="idCard != null"> <if test="idCard != null">
id_card = #{idCard,jdbcType=VARCHAR}, id_card = #{idCard,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
<if test="visitType != null"> <if test="visitType != null">
visit_type = #{visitType,jdbcType=VARCHAR}, visit_type = #{visitType,jdbcType=VARCHAR},
</if> </if>
@ -761,12 +788,16 @@
<if test="remark != null"> <if test="remark != null">
remark = #{remark,jdbcType=VARCHAR}, remark = #{remark,jdbcType=VARCHAR},
</if> </if>
<if test="sync != null">
sync = #{sync,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
<update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo"> <update id="updateByPrimaryKey" parameterType="com.ccsens.system.domain.po.DockPatientVisitInfo">
update dock_patient_visit_info update dock_patient_visit_info
set id_card = #{idCard,jdbcType=VARCHAR}, set id_card = #{idCard,jdbcType=VARCHAR},
patient_no = #{patientNo,jdbcType=VARCHAR},
visit_type = #{visitType,jdbcType=VARCHAR}, visit_type = #{visitType,jdbcType=VARCHAR},
visit_no = #{visitNo,jdbcType=VARCHAR}, visit_no = #{visitNo,jdbcType=VARCHAR},
age = #{age,jdbcType=INTEGER}, age = #{age,jdbcType=INTEGER},
@ -807,7 +838,8 @@
update_by = #{updateBy,jdbcType=VARCHAR}, update_by = #{updateBy,jdbcType=VARCHAR},
update_time = #{updateTime,jdbcType=TIMESTAMP}, update_time = #{updateTime,jdbcType=TIMESTAMP},
del_flag = #{delFlag,jdbcType=TINYINT}, del_flag = #{delFlag,jdbcType=TINYINT},
remark = #{remark,jdbcType=VARCHAR} remark = #{remark,jdbcType=VARCHAR},
sync = #{sync,jdbcType=VARCHAR}
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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="id_card_type_other" jdbcType="VARCHAR" property="idCardTypeOther" />
<result column="abo_blood_type" jdbcType="VARCHAR" property="aboBloodType" /> <result column="abo_blood_type" jdbcType="VARCHAR" property="aboBloodType" />
<result column="rh_blood_type" jdbcType="VARCHAR" property="rhBloodType" /> <result column="rh_blood_type" jdbcType="VARCHAR" property="rhBloodType" />
<result column="patient_no" jdbcType="VARCHAR" property="patientNo" />
</resultMap> </resultMap>
<sql id="Example_Where_Clause"> <sql id="Example_Where_Clause">
<where> <where>
@ -114,7 +115,7 @@
city, address, domicile, independent_living_skills, dwelling_state, recorder, remark, city, address, domicile, independent_living_skills, dwelling_state, recorder, remark,
create_by, create_time, update_by, update_time, del_flag, birth_year, birthday, belief, 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, 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> </sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultMap="BaseResultMap"> <select id="selectByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultMap="BaseResultMap">
select select
@ -162,7 +163,7 @@
belief, hobby, contact_name, belief, hobby, contact_name,
contact_relation, contact_mobile, contact_other, contact_relation, contact_mobile, contact_other,
id_card_type, id_card_type_other, abo_blood_type, 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}, values (#{id,jdbcType=BIGINT}, #{userId,jdbcType=BIGINT}, #{hospitalId,jdbcType=BIGINT},
#{name,jdbcType=VARCHAR}, #{nameInitial,jdbcType=VARCHAR}, #{nameFull,jdbcType=VARCHAR}, #{name,jdbcType=VARCHAR}, #{nameInitial,jdbcType=VARCHAR}, #{nameFull,jdbcType=VARCHAR},
#{patientNumber,jdbcType=VARCHAR}, #{hospitalNumber,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR}, #{patientNumber,jdbcType=VARCHAR}, #{hospitalNumber,jdbcType=VARCHAR}, #{idcard,jdbcType=VARCHAR},
@ -178,7 +179,7 @@
#{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR}, #{belief,jdbcType=VARCHAR}, #{hobby,jdbcType=VARCHAR}, #{contactName,jdbcType=VARCHAR},
#{contactRelation,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{contactOther,jdbcType=VARCHAR}, #{contactRelation,jdbcType=VARCHAR}, #{contactMobile,jdbcType=VARCHAR}, #{contactOther,jdbcType=VARCHAR},
#{idCardType,jdbcType=VARCHAR}, #{idCardTypeOther,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR}, #{idCardType,jdbcType=VARCHAR}, #{idCardTypeOther,jdbcType=VARCHAR}, #{aboBloodType,jdbcType=VARCHAR},
#{rhBloodType,jdbcType=VARCHAR}) #{rhBloodType,jdbcType=VARCHAR}, #{patientNo,jdbcType=VARCHAR})
</insert> </insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.PmsPatient"> <insert id="insertSelective" parameterType="com.ccsens.system.domain.po.PmsPatient">
insert into pms_patient insert into pms_patient
@ -321,6 +322,9 @@
<if test="rhBloodType != null"> <if test="rhBloodType != null">
rh_blood_type, rh_blood_type,
</if> </if>
<if test="patientNo != null">
patient_no,
</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null"> <if test="id != null">
@ -461,6 +465,9 @@
<if test="rhBloodType != null"> <if test="rhBloodType != null">
#{rhBloodType,jdbcType=VARCHAR}, #{rhBloodType,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
#{patientNo,jdbcType=VARCHAR},
</if>
</trim> </trim>
</insert> </insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultType="java.lang.Long"> <select id="countByExample" parameterType="com.ccsens.system.domain.po.PmsPatientExample" resultType="java.lang.Long">
@ -610,6 +617,9 @@
<if test="record.rhBloodType != null"> <if test="record.rhBloodType != null">
rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR}, rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR},
</if> </if>
<if test="record.patientNo != null">
patient_no = #{record.patientNo,jdbcType=VARCHAR},
</if>
</set> </set>
<if test="_parameter != null"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
@ -662,7 +672,8 @@
id_card_type = #{record.idCardType,jdbcType=VARCHAR}, id_card_type = #{record.idCardType,jdbcType=VARCHAR},
id_card_type_other = #{record.idCardTypeOther,jdbcType=VARCHAR}, id_card_type_other = #{record.idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{record.aboBloodType,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"> <if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" /> <include refid="Update_By_Example_Where_Clause" />
</if> </if>
@ -805,6 +816,9 @@
<if test="rhBloodType != null"> <if test="rhBloodType != null">
rh_blood_type = #{rhBloodType,jdbcType=VARCHAR}, rh_blood_type = #{rhBloodType,jdbcType=VARCHAR},
</if> </if>
<if test="patientNo != null">
patient_no = #{patientNo,jdbcType=VARCHAR},
</if>
</set> </set>
where id = #{id,jdbcType=BIGINT} where id = #{id,jdbcType=BIGINT}
</update> </update>
@ -854,7 +868,8 @@
id_card_type = #{idCardType,jdbcType=VARCHAR}, id_card_type = #{idCardType,jdbcType=VARCHAR},
id_card_type_other = #{idCardTypeOther,jdbcType=VARCHAR}, id_card_type_other = #{idCardTypeOther,jdbcType=VARCHAR},
abo_blood_type = #{aboBloodType,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} where id = #{id,jdbcType=BIGINT}
</update> </update>
</mapper> </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 != ''"> <if test="status != null and status != ''">
AND status = #{status} AND status = #{status}
</if> </if>
<if test="deptCode != null and deptCode != ''">
AND dept_code = #{deptCode}
</if>
<!-- 数据范围过滤 --> <!-- 数据范围过滤 -->
${params.dataScope} ${params.dataScope}
order by d.parent_id, d.order_num 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 where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1
</select> </select>
<insert id="insertDept" parameterType="SysDept"> <insert id="insertDept" parameterType="SysDept" useGeneratedKeys="true" keyProperty="deptId">
insert into ums_dept( insert into ums_dept(
<if test="deptId != null and deptId != 0">dept_id,</if> <if test="deptId != null and deptId != 0">dept_id,</if>
<if test="parentId != null and parentId != 0">parent_id,</if> <if test="parentId != null and parentId != 0">parent_id,</if>
<if test="deptName != null and deptName != ''">dept_name,</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="ancestors != null and ancestors != ''">ancestors,</if>
<if test="orderNum != null">order_num,</if> <if test="orderNum != null">order_num,</if>
<if test="leader != null and leader != ''">leader,</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="deptId != null and deptId != 0">#{deptId},</if>
<if test="parentId != null and parentId != 0">#{parentId},</if> <if test="parentId != null and parentId != 0">#{parentId},</if>
<if test="deptName != null and deptName != ''">#{deptName},</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="ancestors != null and ancestors != ''">#{ancestors},</if>
<if test="orderNum != null">#{orderNum},</if> <if test="orderNum != null">#{orderNum},</if>
<if test="leader != null and leader != ''">#{leader},</if> <if test="leader != null and leader != ''">#{leader},</if>
@ -120,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<set> <set>
<if test="parentId != null and parentId != 0">parent_id = #{parentId},</if> <if test="parentId != null and parentId != 0">parent_id = #{parentId},</if>
<if test="deptName != null and deptName != ''">dept_name = #{deptName},</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="ancestors != null and ancestors != ''">ancestors = #{ancestors},</if>
<if test="orderNum != null">order_num = #{orderNum},</if> <if test="orderNum != null">order_num = #{orderNum},</if>
<if test="leader != null">leader = #{leader},</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 != ''"> <if test="userName != null and userName != ''">
AND u.user_name like concat('%', #{userName}, '%') AND u.user_name like concat('%', #{userName}, '%')
</if> </if>
<if test="emplCode != null and emplCode != ''">
AND u.empl_code = #{emplCode}
</if>
<if test="status != null and status != ''"> <if test="status != null and status != ''">
AND u.status = #{status} AND u.status = #{status}
</if> </if>
@ -160,8 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult"> <select id="selectUserByUserName" parameterType="String" resultMap="SysUserResult">
<include refid="selectUserVo"/> <include refid="selectUserVo"/>
where u.user_name = #{userName} and u.del_flag = '0' where (u.user_name = #{userName} or u.empl_code = #{userName}) and u.del_flag = '0'
group by u.user_id group by u.user_id limit 1
</select> </select>
<select id="selectUserById" parameterType="Long" resultMap="SysUserResult"> <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="postId != null and postId != 0">post_id,</if>
<if test="titleId != null and titleId != 0">title_id,</if> <if test="titleId != null and titleId != 0">title_id,</if>
<if test="userName != null and userName != ''">user_name,</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="nickName != null and nickName != ''">nick_name,</if>
<if test="email != null and email != ''">email,</if> <if test="email != null and email != ''">email,</if>
<if test="avatar != null and avatar != ''">avatar,</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="postId != null and postId != ''">#{postId},</if>
<if test="titleId != null and titleId != ''">#{titleId},</if> <if test="titleId != null and titleId != ''">#{titleId},</if>
<if test="userName != null and userName != ''">#{userName},</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="nickName != null and nickName != ''">#{nickName},</if>
<if test="email != null and email != ''">#{email},</if> <if test="email != null and email != ''">#{email},</if>
<if test="avatar != null and avatar != ''">#{avatar},</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);
}
}

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

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

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

@ -12,10 +12,10 @@ spring:
# 从库数据源 # 从库数据源
slave: slave:
# 从数据源开关/默认关闭 # 从数据源开关/默认关闭
enabled: false enabled: true
url: url: jdbc:mysql://172.16.21.24:23306/ruisi_cga_hnszyyy?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
username: username: root
password: password: xian#2024!!!
# 初始连接数 # 初始连接数
initialSize: 5 initialSize: 5
# 最小连接池数量 # 最小连接池数量
@ -62,13 +62,13 @@ spring:
# redis 配置 # redis 配置
redis: redis:
# 地址 # 地址
host: localhost host: 172.16.21.24
# 端口,默认为6379 # 端口,默认为6379
port: 6379 port: 26379
# 数据库索引 # 数据库索引
database: 1 database: 1
# 密码 # 密码
password: 123456 password: redis111^#
# 连接超时时间 # 连接超时时间
timeout: 10s timeout: 10s
lettuce: lettuce:
@ -81,6 +81,20 @@ spring:
max-active: 8 max-active: 8
# #连接池最大阻塞等待时间(使用负值表示没有限制) # #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait: -1ms 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: app:
# 是否开启调式模式 # 是否开启调式模式
@ -114,4 +128,8 @@ informed:
#clientVersion: v1.6.8 #clientVersion: v1.6.8
#clientVersion: v1.8.1.0 #clientVersion: v1.8.1.0
#clientVersion: v1.8.2.0 #clientVersion: v1.8.2.0
clientVersion: v1.8.3.0 clientVersion: v1.8.3.0
# 医院id,不同医院部署的时候需要修改
hospitalId: 178
generalPassword: cga123#

339
sql/数据对接.sql

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