diff --git a/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java b/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java index ea9a2b5..31c8fca 100644 --- a/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java +++ b/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysDept.java @@ -74,6 +74,8 @@ public class SysDept extends BaseEntity { */ private String parentName; + private String deptCode; + /** * 子部门 */ @@ -181,6 +183,14 @@ public class SysDept extends BaseEntity { this.children = children; } + public String getDeptCode() { + return deptCode; + } + + public void setDeptCode(String deptCode) { + this.deptCode = deptCode; + } + @Override public String toString() { return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java b/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java index 99cec3e..eed53fd 100644 --- a/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java +++ b/ruisi_java/ruisi-cc-common/src/main/java/com/ccsens/common/core/domain/entity/SysUser.java @@ -68,6 +68,12 @@ public class SysUser extends BaseEntity { @ExcelTable(name = "登录名称") private String userName; + /** + * 工号 + */ + @ExcelTable(name = "工号") + private String emplCode; + /** * 用户昵称 */ @@ -296,6 +302,14 @@ public class SysUser extends BaseEntity { this.userName = userName; } + public String getEmplCode() { + return emplCode; + } + + public void setEmplCode(String emplCode) { + this.emplCode = emplCode; + } + @Email(message = "邮箱格式不正确") @Size(min = 0, max = 50, message = "邮箱长度不能超过50个字符") public String getEmail() { diff --git a/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml b/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml index 6cda227..057ebe8 100644 --- a/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml +++ b/ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml @@ -22,7 +22,7 @@ + password="123456"> @@ -60,7 +60,7 @@ - + @@ -70,13 +70,13 @@ - - - - - - -
+
+
+
+
+
+
+ diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java index aeb8691..0020164 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDept.java @@ -20,6 +20,8 @@ public class DockDept implements Serializable { private Date updateTime; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -86,6 +88,14 @@ public class DockDept implements Serializable { this.updateTime = updateTime; } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -100,6 +110,7 @@ public class DockDept implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", updateBy=").append(updateBy); sb.append(", updateTime=").append(updateTime); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java index 25fd30b..a2c6110 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockDeptExample.java @@ -634,6 +634,76 @@ public class DockDeptExample { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java index c6f5a85..8b78ad0 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmpl.java @@ -24,6 +24,8 @@ public class DockEmpl implements Serializable { private Date updateTime; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -106,6 +108,14 @@ public class DockEmpl implements Serializable { this.updateTime = updateTime; } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -122,6 +132,7 @@ public class DockEmpl implements Serializable { sb.append(", createTime=").append(createTime); sb.append(", updateBy=").append(updateBy); sb.append(", updateTime=").append(updateTime); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java index da04a7e..37a6528 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockEmplExample.java @@ -774,6 +774,76 @@ public class DockEmplExample { addCriterion("update_time not between", value1, value2, "updateTime"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java index ec04b17..c4d4fad 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfo.java @@ -8,6 +8,8 @@ public class DockPatientBaseInfo implements Serializable { private String name; + private String patientNo; + private String idCard; private String phone; @@ -56,6 +58,8 @@ public class DockPatientBaseInfo implements Serializable { private String remark; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -74,6 +78,14 @@ public class DockPatientBaseInfo implements Serializable { this.name = name == null ? null : name.trim(); } + public String getPatientNo() { + return patientNo; + } + + public void setPatientNo(String patientNo) { + this.patientNo = patientNo == null ? null : patientNo.trim(); + } + public String getIdCard() { return idCard; } @@ -266,6 +278,14 @@ public class DockPatientBaseInfo implements Serializable { this.remark = remark == null ? null : remark.trim(); } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -274,6 +294,7 @@ public class DockPatientBaseInfo implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", name=").append(name); + sb.append(", patientNo=").append(patientNo); sb.append(", idCard=").append(idCard); sb.append(", phone=").append(phone); sb.append(", sex=").append(sex); @@ -298,6 +319,7 @@ public class DockPatientBaseInfo implements Serializable { sb.append(", updateTime=").append(updateTime); sb.append(", delFlag=").append(delFlag); sb.append(", remark=").append(remark); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java index 0276905..a715339 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientBaseInfoExample.java @@ -262,6 +262,76 @@ public class DockPatientBaseInfoExample { return (Criteria) this; } + public Criteria andPatientNoIsNull() { + addCriterion("patient_no is null"); + return (Criteria) this; + } + + public Criteria andPatientNoIsNotNull() { + addCriterion("patient_no is not null"); + return (Criteria) this; + } + + public Criteria andPatientNoEqualTo(String value) { + addCriterion("patient_no =", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotEqualTo(String value) { + addCriterion("patient_no <>", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThan(String value) { + addCriterion("patient_no >", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThanOrEqualTo(String value) { + addCriterion("patient_no >=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThan(String value) { + addCriterion("patient_no <", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThanOrEqualTo(String value) { + addCriterion("patient_no <=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLike(String value) { + addCriterion("patient_no like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotLike(String value) { + addCriterion("patient_no not like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoIn(List values) { + addCriterion("patient_no in", values, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotIn(List values) { + addCriterion("patient_no not in", values, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoBetween(String value1, String value2) { + addCriterion("patient_no between", value1, value2, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotBetween(String value1, String value2) { + addCriterion("patient_no not between", value1, value2, "patientNo"); + return (Criteria) this; + } + public Criteria andIdCardIsNull() { addCriterion("id_card is null"); return (Criteria) this; @@ -1901,6 +1971,76 @@ public class DockPatientBaseInfoExample { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java index 6d8891c..1299182 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosis.java @@ -30,6 +30,8 @@ public class DockPatientDiagnosis implements Serializable { private String remark; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -136,6 +138,14 @@ public class DockPatientDiagnosis implements Serializable { this.remark = remark == null ? null : remark.trim(); } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -155,6 +165,7 @@ public class DockPatientDiagnosis implements Serializable { sb.append(", updateTime=").append(updateTime); sb.append(", delFlag=").append(delFlag); sb.append(", remark=").append(remark); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java index 1cd293b..9297c1c 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientDiagnosisExample.java @@ -981,6 +981,76 @@ public class DockPatientDiagnosisExample { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java index ca1d6ca..9b2a3f9 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfo.java @@ -29,6 +29,8 @@ public class DockPatientMedicationInfo implements Serializable { private String remark; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -127,6 +129,14 @@ public class DockPatientMedicationInfo implements Serializable { this.remark = remark == null ? null : remark.trim(); } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -145,6 +155,7 @@ public class DockPatientMedicationInfo implements Serializable { sb.append(", updateTime=").append(updateTime); sb.append(", delFlag=").append(delFlag); sb.append(", remark=").append(remark); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java index 6750df9..f58286a 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientMedicationInfoExample.java @@ -895,6 +895,76 @@ public class DockPatientMedicationInfoExample { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java index 4063156..e1c25ed 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfo.java @@ -9,6 +9,8 @@ public class DockPatientVisitInfo implements Serializable { private String idCard; + private String patientNo; + private String visitType; private String visitNo; @@ -91,6 +93,8 @@ public class DockPatientVisitInfo implements Serializable { private String remark; + private String sync; + private static final long serialVersionUID = 1L; public Long getId() { @@ -109,6 +113,14 @@ public class DockPatientVisitInfo implements Serializable { this.idCard = idCard == null ? null : idCard.trim(); } + public String getPatientNo() { + return patientNo; + } + + public void setPatientNo(String patientNo) { + this.patientNo = patientNo == null ? null : patientNo.trim(); + } + public String getVisitType() { return visitType; } @@ -437,6 +449,14 @@ public class DockPatientVisitInfo implements Serializable { this.remark = remark == null ? null : remark.trim(); } + public String getSync() { + return sync; + } + + public void setSync(String sync) { + this.sync = sync == null ? null : sync.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -445,6 +465,7 @@ public class DockPatientVisitInfo implements Serializable { sb.append("Hash = ").append(hashCode()); sb.append(", id=").append(id); sb.append(", idCard=").append(idCard); + sb.append(", patientNo=").append(patientNo); sb.append(", visitType=").append(visitType); sb.append(", visitNo=").append(visitNo); sb.append(", age=").append(age); @@ -486,6 +507,7 @@ public class DockPatientVisitInfo implements Serializable { sb.append(", updateTime=").append(updateTime); sb.append(", delFlag=").append(delFlag); sb.append(", remark=").append(remark); + sb.append(", sync=").append(sync); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java index bdd0980..273ce1c 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/DockPatientVisitInfoExample.java @@ -236,6 +236,76 @@ public class DockPatientVisitInfoExample { return (Criteria) this; } + public Criteria andPatientNoIsNull() { + addCriterion("patient_no is null"); + return (Criteria) this; + } + + public Criteria andPatientNoIsNotNull() { + addCriterion("patient_no is not null"); + return (Criteria) this; + } + + public Criteria andPatientNoEqualTo(String value) { + addCriterion("patient_no =", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotEqualTo(String value) { + addCriterion("patient_no <>", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThan(String value) { + addCriterion("patient_no >", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThanOrEqualTo(String value) { + addCriterion("patient_no >=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThan(String value) { + addCriterion("patient_no <", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThanOrEqualTo(String value) { + addCriterion("patient_no <=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLike(String value) { + addCriterion("patient_no like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotLike(String value) { + addCriterion("patient_no not like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoIn(List values) { + addCriterion("patient_no in", values, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotIn(List values) { + addCriterion("patient_no not in", values, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoBetween(String value1, String value2) { + addCriterion("patient_no between", value1, value2, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotBetween(String value1, String value2) { + addCriterion("patient_no not between", value1, value2, "patientNo"); + return (Criteria) this; + } + public Criteria andVisitTypeIsNull() { addCriterion("visit_type is null"); return (Criteria) this; @@ -2805,6 +2875,76 @@ public class DockPatientVisitInfoExample { addCriterion("remark not between", value1, value2, "remark"); return (Criteria) this; } + + public Criteria andSyncIsNull() { + addCriterion("sync is null"); + return (Criteria) this; + } + + public Criteria andSyncIsNotNull() { + addCriterion("sync is not null"); + return (Criteria) this; + } + + public Criteria andSyncEqualTo(String value) { + addCriterion("sync =", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotEqualTo(String value) { + addCriterion("sync <>", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThan(String value) { + addCriterion("sync >", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncGreaterThanOrEqualTo(String value) { + addCriterion("sync >=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThan(String value) { + addCriterion("sync <", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLessThanOrEqualTo(String value) { + addCriterion("sync <=", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncLike(String value) { + addCriterion("sync like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotLike(String value) { + addCriterion("sync not like", value, "sync"); + return (Criteria) this; + } + + public Criteria andSyncIn(List values) { + addCriterion("sync in", values, "sync"); + return (Criteria) this; + } + + public Criteria andSyncNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java index cb488b2..c0eae86 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatient.java @@ -96,6 +96,8 @@ public class PmsPatient implements Serializable { private String rhBloodType; + private String patientNo; + private static final long serialVersionUID = 1L; public Long getId() { @@ -466,6 +468,14 @@ public class PmsPatient implements Serializable { this.rhBloodType = rhBloodType == null ? null : rhBloodType.trim(); } + public String getPatientNo() { + return patientNo; + } + + public void setPatientNo(String patientNo) { + this.patientNo = patientNo == null ? null : patientNo.trim(); + } + @Override public String toString() { StringBuilder sb = new StringBuilder(); @@ -518,6 +528,7 @@ public class PmsPatient implements Serializable { sb.append(", idCardTypeOther=").append(idCardTypeOther); sb.append(", aboBloodType=").append(aboBloodType); sb.append(", rhBloodType=").append(rhBloodType); + sb.append(", patientNo=").append(patientNo); sb.append("]"); return sb.toString(); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java index c228e16..4aa7125 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientExample.java @@ -3154,6 +3154,76 @@ public class PmsPatientExample { addCriterion("rh_blood_type not between", value1, value2, "rhBloodType"); return (Criteria) this; } + + public Criteria andPatientNoIsNull() { + addCriterion("patient_no is null"); + return (Criteria) this; + } + + public Criteria andPatientNoIsNotNull() { + addCriterion("patient_no is not null"); + return (Criteria) this; + } + + public Criteria andPatientNoEqualTo(String value) { + addCriterion("patient_no =", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotEqualTo(String value) { + addCriterion("patient_no <>", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThan(String value) { + addCriterion("patient_no >", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoGreaterThanOrEqualTo(String value) { + addCriterion("patient_no >=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThan(String value) { + addCriterion("patient_no <", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLessThanOrEqualTo(String value) { + addCriterion("patient_no <=", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoLike(String value) { + addCriterion("patient_no like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotLike(String value) { + addCriterion("patient_no not like", value, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoIn(List values) { + addCriterion("patient_no in", values, "patientNo"); + return (Criteria) this; + } + + public Criteria andPatientNoNotIn(List 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 { diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java index 1e2d7c1..31f5d54 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/DockService.java @@ -1,8 +1,11 @@ package com.ccsens.system.service; +import com.ccsens.common.core.domain.entity.SysDept; +import com.ccsens.common.core.domain.entity.SysUser; import com.ccsens.system.domain.dto.DockDto; import java.util.Date; +import java.util.List; /** * @Author zzc @@ -23,4 +26,10 @@ public interface DockService { */ void pulling(Date startTime, Date endTime); + void syncHospitalData(); + + List syncUmsDeptSlave(); + void syncUmsDeptMaster(List sysDepts); + List syncUmsUserSlave(); + void syncUmsUserMaster(List sysUsers); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java index 32c5554..5ee88e6 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java @@ -2,25 +2,39 @@ package com.ccsens.system.service.impl; import cn.hutool.core.bean.BeanUtil; import cn.hutool.core.collection.CollUtil; +import cn.hutool.core.date.DateField; import cn.hutool.core.date.DateUtil; import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.ObjectUtil; import cn.hutool.extra.pinyin.PinyinUtil; +import com.ccsens.common.annotation.DataSource; import com.ccsens.common.constant.ErrorConstant; +import com.ccsens.common.core.domain.entity.SysDept; +import com.ccsens.common.core.domain.entity.SysUser; +import com.ccsens.common.enums.DataSourceType; import com.ccsens.common.exception.base.BaseException; +import com.ccsens.common.utils.DateUtils; +import com.ccsens.common.utils.SecurityUtils; +import com.ccsens.common.utils.StringUtils; +import com.ccsens.system.domain.SysUserRole; import com.ccsens.system.domain.dto.DockDto; import com.ccsens.system.domain.po.*; import com.ccsens.system.persist.dao.DockDao; import com.ccsens.system.persist.mapper.*; import com.ccsens.system.service.DmsDataValueService; import com.ccsens.system.service.DockService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Propagation; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Author zzc @@ -28,8 +42,8 @@ import java.util.List; * @Date 2026/2/9 14:55 * @description: */ +@Slf4j @Service -@Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public class DockServiceImpl implements DockService { @Resource @@ -54,11 +68,23 @@ public class DockServiceImpl implements DockService { @Resource private PmsPatientBodyMapper pmsPatientBodyMapper; @Resource - private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper; + private PmsPatientDiagnosisMapper pmsPatientDiagnosisMapper; @Resource private PmsPatientParentIllnessMapper pmsPatientParentIllnessMapper; + @Resource + private SysDeptMapper sysDeptMapper; + @Resource + private SysUserMapper sysUserMapper; + @Resource + private SysUserRoleMapper userRoleMapper; + + @Value("${hospitalId:}") + private Long hospitalId; + @Value("${generalPassword:}") + private String generalPassword; @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public Integer addDockPatient(DockDto.AddPatientDto dto) { DockDto.PatientInfo patientInfo = dto.getBasicInfo(); @@ -115,6 +141,7 @@ public class DockServiceImpl implements DockService { } @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public void addDept(DockDto.DockDeptInfo dto) { DockDept dockDept = BeanUtil.copyProperties(dto, DockDept.class); dockDeptMapper.insertSelective(dockDept); @@ -127,6 +154,7 @@ public class DockServiceImpl implements DockService { } @Override + @Transactional(propagation = Propagation.REQUIRED, rollbackFor = Exception.class) public void pulling(Date startTime, Date endTime) { //1.判断是否有处于processing状态的操作日志 if (dmsDataValueService.isProcessing()) { @@ -241,7 +269,7 @@ public class DockServiceImpl implements DockService { } } - }else { + } else { //不存在新增 PmsPatient pmsPatient = BeanUtil.copyProperties(dockPatientBaseInfo, PmsPatient.class); 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 sysUsers) { + if (CollUtil.isNotEmpty(sysUsers)) { + for (SysUser sysUser : sysUsers) { + //根据code查找用户 + SysUser user = new SysUser(); + user.setEmplCode(sysUser.getEmplCode()); + List 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 syncUmsUserSlave() { + List returnUsers = new ArrayList<>(); + DockEmplExample dockEmplExample = new DockEmplExample(); + dockEmplExample.createCriteria().andSyncEqualTo("0").andDelFlagEqualTo("0"); + List dockEmpls = dockEmplMapper.selectByExample(dockEmplExample); + if (CollUtil.isEmpty(dockEmpls)) { + return returnUsers; + } + for (DockEmpl dockEmpl : dockEmpls) { + //根据code查找部门信息 + SysDept sysDept = new SysDept(); + sysDept.setDeptCode(dockEmpl.getDeptCode()); + List sysDepts = sysDeptMapper.selectDeptList(sysDept); + if (CollUtil.isEmpty(sysDepts)) { + continue; + } else { + sysDept = sysDepts.get(0); + } + SysUser sysUser = new SysUser(); + sysUser.setEmplCode(dockEmpl.getEmplCode()); + List 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 syncUmsDeptSlave() { + List returnDepts = new ArrayList<>(); + //查找同步表中的部门信息 + DockDeptExample dockDeptExample = new DockDeptExample(); + dockDeptExample.createCriteria().andSyncEqualTo("0").andDelFlagEqualTo("0"); + List dockDepts = dockDeptMapper.selectByExample(dockDeptExample); + if (CollUtil.isEmpty(dockDepts)) { + return returnDepts; + } + for (DockDept dockDept : dockDepts) { + //根据code查找系统的部门信息 + SysDept sysDept = new SysDept(); + sysDept.setDeptCode(dockDept.getDeptCode()); + List 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 sysDepts) { + if (CollUtil.isNotEmpty(sysDepts)) { + sysDepts.forEach(sysDept -> { + //根据code查找系统的部门信息 + SysDept dept = new SysDept(); + dept.setDeptCode(sysDept.getDeptCode()); + List 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 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 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 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 pmsPatients = pmsPatientMapper.selectByExample(pmsPatientExample); + if (CollUtil.isEmpty(pmsPatients)) { + //根据患者唯一编号查找同步表的患者信息 + DockPatientBaseInfoExample dockPatientBaseInfoExample = new DockPatientBaseInfoExample(); + dockPatientBaseInfoExample.createCriteria().andIdCardEqualTo(dockPatientVisitInfo.getPatientNo()).andDelFlagEqualTo((byte) 0); + List 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 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 dockPatientDiagnosiss = dockPatientDiagnosisMapper.selectByExample(dockPatientDiagnosisExample); + if (CollUtil.isEmpty(dockPatientDiagnosiss)) { + return; + } + //将诊断数据根据就诊流水号进行分组 + Map> 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 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 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 dockPatientMedicationInfos = dockPatientMedicationInfoMapper.selectByExample(dockPatientMedicationInfoExample); + if (CollUtil.isEmpty(dockPatientMedicationInfos)) { + return; + } + //将疾病信息根据就诊流水号进行分组 + Map> 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 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 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()); + } + + } diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml index 3766710..39560e4 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockDeptMapper.xml @@ -10,6 +10,7 @@ + @@ -70,7 +71,8 @@ - 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 @@ -198,6 +208,9 @@ update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -212,7 +225,8 @@ create_by = #{record.createBy,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP}, update_by = #{record.updateBy,jdbcType=VARCHAR}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -241,6 +255,9 @@ update_time = #{updateTime,jdbcType=TIMESTAMP}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -252,7 +269,8 @@ create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_by = #{updateBy,jdbcType=VARCHAR}, - update_time = #{updateTime,jdbcType=TIMESTAMP} + update_time = #{updateTime,jdbcType=TIMESTAMP}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml index 30ab0d3..ece5edb 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockEmplMapper.xml @@ -12,6 +12,7 @@ + @@ -73,7 +74,7 @@ id, empl_name, empl_code, empl_type, dept_code, del_flag, create_by, create_time, - update_by, update_time + update_by, update_time, sync @@ -221,6 +228,9 @@ update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -237,7 +247,8 @@ create_by = #{record.createBy,jdbcType=VARCHAR}, create_time = #{record.createTime,jdbcType=TIMESTAMP}, update_by = #{record.updateBy,jdbcType=VARCHAR}, - update_time = #{record.updateTime,jdbcType=TIMESTAMP} + update_time = #{record.updateTime,jdbcType=TIMESTAMP}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -272,6 +283,9 @@ update_time = #{updateTime,jdbcType=TIMESTAMP}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -285,7 +299,8 @@ create_by = #{createBy,jdbcType=VARCHAR}, create_time = #{createTime,jdbcType=TIMESTAMP}, update_by = #{updateBy,jdbcType=VARCHAR}, - update_time = #{updateTime,jdbcType=TIMESTAMP} + update_time = #{updateTime,jdbcType=TIMESTAMP}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml index 479e2fb..88cf0e6 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientBaseInfoMapper.xml @@ -4,6 +4,7 @@ + @@ -28,6 +29,7 @@ + @@ -88,10 +90,10 @@ - id, name, id_card, phone, sex, birthday, educational_status, career, marital_status, - nation, native_place, address, dwelling_state, contact_name, contact_mobile, contact_relation, - abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time, update_by, - update_time, del_flag, remark + id, name, patient_no, id_card, phone, sex, birthday, educational_status, career, + marital_status, nation, native_place, address, dwelling_state, contact_name, contact_mobile, + contact_relation, abo_blood_type, rh_blood_type, belief, hobby, create_by, create_time, + update_by, update_time, del_flag, remark, sync @@ -321,6 +337,9 @@ name = #{record.name,jdbcType=VARCHAR}, + + patient_no = #{record.patientNo,jdbcType=VARCHAR}, + id_card = #{record.idCard,jdbcType=VARCHAR}, @@ -393,6 +412,9 @@ remark = #{record.remark,jdbcType=VARCHAR}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -402,6 +424,7 @@ update dock_patient_base_info set id = #{record.id,jdbcType=BIGINT}, name = #{record.name,jdbcType=VARCHAR}, + patient_no = #{record.patientNo,jdbcType=VARCHAR}, id_card = #{record.idCard,jdbcType=VARCHAR}, phone = #{record.phone,jdbcType=VARCHAR}, sex = #{record.sex,jdbcType=VARCHAR}, @@ -425,7 +448,8 @@ update_by = #{record.updateBy,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, del_flag = #{record.delFlag,jdbcType=TINYINT}, - remark = #{record.remark,jdbcType=VARCHAR} + remark = #{record.remark,jdbcType=VARCHAR}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -436,6 +460,9 @@ name = #{name,jdbcType=VARCHAR}, + + patient_no = #{patientNo,jdbcType=VARCHAR}, + id_card = #{idCard,jdbcType=VARCHAR}, @@ -508,12 +535,16 @@ remark = #{remark,jdbcType=VARCHAR}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} update dock_patient_base_info set name = #{name,jdbcType=VARCHAR}, + patient_no = #{patientNo,jdbcType=VARCHAR}, id_card = #{idCard,jdbcType=VARCHAR}, phone = #{phone,jdbcType=VARCHAR}, sex = #{sex,jdbcType=VARCHAR}, @@ -537,7 +568,8 @@ update_by = #{updateBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, del_flag = #{delFlag,jdbcType=TINYINT}, - remark = #{remark,jdbcType=VARCHAR} + remark = #{remark,jdbcType=VARCHAR}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml index a249967..b1382dc 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientDiagnosisMapper.xml @@ -15,6 +15,7 @@ + @@ -76,7 +77,8 @@ 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 @@ -253,6 +261,9 @@ remark = #{record.remark,jdbcType=VARCHAR}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -272,7 +283,8 @@ update_by = #{record.updateBy,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, del_flag = #{record.delFlag,jdbcType=TINYINT}, - remark = #{record.remark,jdbcType=VARCHAR} + remark = #{record.remark,jdbcType=VARCHAR}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -316,6 +328,9 @@ remark = #{remark,jdbcType=VARCHAR}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -332,7 +347,8 @@ update_by = #{updateBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, del_flag = #{delFlag,jdbcType=TINYINT}, - remark = #{remark,jdbcType=VARCHAR} + remark = #{remark,jdbcType=VARCHAR}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml index e6e6ebe..34a285c 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientMedicationInfoMapper.xml @@ -14,6 +14,7 @@ + @@ -75,7 +76,7 @@ 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 @@ -243,6 +250,9 @@ remark = #{record.remark,jdbcType=VARCHAR}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -261,7 +271,8 @@ update_by = #{record.updateBy,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, del_flag = #{record.delFlag,jdbcType=TINYINT}, - remark = #{record.remark,jdbcType=VARCHAR} + remark = #{record.remark,jdbcType=VARCHAR}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -302,6 +313,9 @@ remark = #{remark,jdbcType=VARCHAR}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -317,7 +331,8 @@ update_by = #{updateBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, del_flag = #{delFlag,jdbcType=TINYINT}, - remark = #{remark,jdbcType=VARCHAR} + remark = #{remark,jdbcType=VARCHAR}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml index 1097ab1..359cc5d 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/DockPatientVisitInfoMapper.xml @@ -4,6 +4,7 @@ + @@ -45,6 +46,7 @@ + @@ -105,13 +107,13 @@ - id, id_card, visit_type, visit_no, age, department, doctor, admission_date, admission_count, - bed_number, discharge_date, admission_method, discharge_method, height, weight, tz, - temperature, blood_pressure_shrink, blood_pressure_diastole, pulse, creatinine, oxygen_saturation, - albumin, total_protein, vitamin_d3, hematocrit, dimer, smoking_history, smoking_year, - smoking_quit, smoking_quit_year, drink_history, drink_year, drink_quit, drink_quit_year, - has_allergy, allergy_drug, create_by, create_time, update_by, update_time, del_flag, - remark + id, id_card, patient_no, visit_type, visit_no, age, department, doctor, admission_date, + admission_count, bed_number, discharge_date, admission_method, discharge_method, + height, weight, tz, temperature, blood_pressure_shrink, blood_pressure_diastole, + pulse, creatinine, oxygen_saturation, albumin, total_protein, vitamin_d3, hematocrit, + dimer, smoking_history, smoking_year, smoking_quit, smoking_quit_year, drink_history, + drink_year, drink_quit, drink_quit_year, has_allergy, allergy_drug, create_by, create_time, + update_by, update_time, del_flag, remark, sync @@ -455,6 +471,9 @@ id_card = #{record.idCard,jdbcType=VARCHAR}, + + patient_no = #{record.patientNo,jdbcType=VARCHAR}, + visit_type = #{record.visitType,jdbcType=VARCHAR}, @@ -578,6 +597,9 @@ remark = #{record.remark,jdbcType=VARCHAR}, + + sync = #{record.sync,jdbcType=VARCHAR}, + @@ -587,6 +609,7 @@ update dock_patient_visit_info set id = #{record.id,jdbcType=BIGINT}, id_card = #{record.idCard,jdbcType=VARCHAR}, + patient_no = #{record.patientNo,jdbcType=VARCHAR}, visit_type = #{record.visitType,jdbcType=VARCHAR}, visit_no = #{record.visitNo,jdbcType=VARCHAR}, age = #{record.age,jdbcType=INTEGER}, @@ -627,7 +650,8 @@ update_by = #{record.updateBy,jdbcType=VARCHAR}, update_time = #{record.updateTime,jdbcType=TIMESTAMP}, del_flag = #{record.delFlag,jdbcType=TINYINT}, - remark = #{record.remark,jdbcType=VARCHAR} + remark = #{record.remark,jdbcType=VARCHAR}, + sync = #{record.sync,jdbcType=VARCHAR} @@ -638,6 +662,9 @@ id_card = #{idCard,jdbcType=VARCHAR}, + + patient_no = #{patientNo,jdbcType=VARCHAR}, + visit_type = #{visitType,jdbcType=VARCHAR}, @@ -761,12 +788,16 @@ remark = #{remark,jdbcType=VARCHAR}, + + sync = #{sync,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} update dock_patient_visit_info set id_card = #{idCard,jdbcType=VARCHAR}, + patient_no = #{patientNo,jdbcType=VARCHAR}, visit_type = #{visitType,jdbcType=VARCHAR}, visit_no = #{visitNo,jdbcType=VARCHAR}, age = #{age,jdbcType=INTEGER}, @@ -807,7 +838,8 @@ update_by = #{updateBy,jdbcType=VARCHAR}, update_time = #{updateTime,jdbcType=TIMESTAMP}, del_flag = #{delFlag,jdbcType=TINYINT}, - remark = #{remark,jdbcType=VARCHAR} + remark = #{remark,jdbcType=VARCHAR}, + sync = #{sync,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml index 99e13b9..23fd37a 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientMapper.xml @@ -48,6 +48,7 @@ + @@ -114,7 +115,7 @@ city, address, domicile, independent_living_skills, dwelling_state, recorder, remark, create_by, create_time, update_by, update_time, del_flag, birth_year, birthday, belief, hobby, contact_name, contact_relation, contact_mobile, contact_other, id_card_type, - id_card_type_other, abo_blood_type, rh_blood_type + id_card_type_other, abo_blood_type, rh_blood_type, patient_no @@ -610,6 +617,9 @@ rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR}, + + patient_no = #{record.patientNo,jdbcType=VARCHAR}, + @@ -662,7 +672,8 @@ id_card_type = #{record.idCardType,jdbcType=VARCHAR}, id_card_type_other = #{record.idCardTypeOther,jdbcType=VARCHAR}, abo_blood_type = #{record.aboBloodType,jdbcType=VARCHAR}, - rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR} + rh_blood_type = #{record.rhBloodType,jdbcType=VARCHAR}, + patient_no = #{record.patientNo,jdbcType=VARCHAR} @@ -805,6 +816,9 @@ rh_blood_type = #{rhBloodType,jdbcType=VARCHAR}, + + patient_no = #{patientNo,jdbcType=VARCHAR}, + where id = #{id,jdbcType=BIGINT} @@ -854,7 +868,8 @@ id_card_type = #{idCardType,jdbcType=VARCHAR}, id_card_type_other = #{idCardTypeOther,jdbcType=VARCHAR}, abo_blood_type = #{aboBloodType,jdbcType=VARCHAR}, - rh_blood_type = #{rhBloodType,jdbcType=VARCHAR} + rh_blood_type = #{rhBloodType,jdbcType=VARCHAR}, + patient_no = #{patientNo,jdbcType=VARCHAR} where id = #{id,jdbcType=BIGINT} \ No newline at end of file diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml index aa8bf4e..efd1783 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysDeptMapper.xml @@ -42,6 +42,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND status = #{status} + + AND dept_code = #{deptCode} + ${params.dataScope} order by d.parent_id, d.order_num @@ -87,11 +90,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" where dept_name=#{deptName} and parent_id = #{parentId} and del_flag = '0' limit 1 - + insert into ums_dept( dept_id, parent_id, dept_name, + dept_code, ancestors, order_num, leader, @@ -104,6 +108,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{deptId}, #{parentId}, #{deptName}, + #{deptCode}, #{ancestors}, #{orderNum}, #{leader}, @@ -120,6 +125,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" parent_id = #{parentId}, dept_name = #{deptName}, + dept_code = #{deptCode}, ancestors = #{ancestors}, order_num = #{orderNum}, leader = #{leader}, diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml index 85aea90..69b1035 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -104,6 +104,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND u.user_name like concat('%', #{userName}, '%') + + AND u.empl_code = #{emplCode} + AND u.status = #{status} @@ -160,8 +163,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"