Browse Source

电力同步时处理部门id

hnsdlyy
zhangye 10 hours ago
parent
commit
41e33285c6
  1. 18
      ruisi_java/ruisi-cc-generator/src/main/resources/mbg.xml
  2. 11
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientBody.java
  3. 60
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientBodyExample.java
  4. 3
      ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/DockServiceImpl.java
  5. 25
      ruisi_java/ruisi-system/src/main/resources/mapper/system/PmsPatientBodyMapper.xml
  6. 59
      ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml

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

@ -20,9 +20,9 @@
</commentGenerator>
<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_yf?useUnicode=true&amp;characterEncoding=UTF-8&amp;serverTimezone=GMT%2B8&amp;tinyInt1isBit=false"
userId="root"
password="q7510327">
password="123456">
<!--仅仅查询当前库的表,不查询其他库-->
<property name="nullCatalogMeansCurrent" value="true"/>
</jdbcConnection>
@ -70,12 +70,12 @@
<!-- <table tableName="pms_patient_parent_illness" domainObjectName="PmsPatientParentIllness"/>-->
<!-- <table tableName="pms_patient_personal" domainObjectName="PmsPatientPersonal"/>-->
<!-- <table tableName="pms_patient_diagnosis" domainObjectName="PmsPatientDiagnosis"/>-->
<table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>
<table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>
<table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>
<table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>
<table tableName="dock_empl" domainObjectName="DockEmpl"/>
<table tableName="dock_dept" domainObjectName="DockDept"/>
<!-- <table tableName="dock_patient_base_info" domainObjectName="DockPatientBaseInfo"/>-->
<!-- <table tableName="dock_patient_diagnosis" domainObjectName="DockPatientDiagnosis"/>-->
<!-- <table tableName="dock_patient_medication_info" domainObjectName="DockPatientMedicationInfo"/>-->
<!-- <table tableName="dock_patient_visit_info" domainObjectName="DockPatientVisitInfo"/>-->
<!-- <table tableName="dock_empl" domainObjectName="DockEmpl"/>-->
<!-- <table tableName="dock_dept" domainObjectName="DockDept"/>-->
<!-- <table tableName="dms_running_log" domainObjectName="DmsRunningLog"/>-->
<!-- <table tableName="hms_combo" domainObjectName="HmsCombo"/>-->
<!-- <table tableName="hms_combo_scale_relevance" domainObjectName="HmsComboScaleRelevance"/>-->
@ -121,7 +121,7 @@
<!-- <table tableName="ams_patient_question_record" domainObjectName="AmsPatientQuestionRecord"/>-->
<!-- <table tableName="ams_patient_question_record_desc" domainObjectName="AmsPatientQuestionRecordDesc"/>-->
<table tableName="rms_report" domainObjectName="RmsReport"/>
<!-- <table tableName="rms_report" domainObjectName="RmsReport"/>-->
<!-- <table tableName="rms_report_basics_record" domainObjectName="RmsReportBasicsRecord"/>-->
<!-- <table tableName="rms_report_range" domainObjectName="RmsReportRange"/>-->
<!-- <table tableName="rms_report_scale_score" domainObjectName="RmsReportScaleScore"/>-->

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

@ -98,6 +98,8 @@ public class PmsPatientBody implements Serializable {
private String visitType;
private Long deptId;
private static final long serialVersionUID = 1L;
public Long getId() {
@ -476,6 +478,14 @@ public class PmsPatientBody implements Serializable {
this.visitType = visitType == null ? null : visitType.trim();
}
public Long getDeptId() {
return deptId;
}
public void setDeptId(Long deptId) {
this.deptId = deptId;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
@ -529,6 +539,7 @@ public class PmsPatientBody implements Serializable {
sb.append(", diagnosisDate=").append(diagnosisDate);
sb.append(", bmi=").append(bmi);
sb.append(", visitType=").append(visitType);
sb.append(", deptId=").append(deptId);
sb.append("]");
return sb.toString();
}

60
ruisi_java/ruisi-system/src/main/java/com/ccsens/system/domain/po/PmsPatientBodyExample.java

@ -3314,6 +3314,66 @@ public class PmsPatientBodyExample {
addCriterion("visit_type not between", value1, value2, "visitType");
return (Criteria) this;
}
public Criteria andDeptIdIsNull() {
addCriterion("dept_id is null");
return (Criteria) this;
}
public Criteria andDeptIdIsNotNull() {
addCriterion("dept_id is not null");
return (Criteria) this;
}
public Criteria andDeptIdEqualTo(Long value) {
addCriterion("dept_id =", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotEqualTo(Long value) {
addCriterion("dept_id <>", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThan(Long value) {
addCriterion("dept_id >", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdGreaterThanOrEqualTo(Long value) {
addCriterion("dept_id >=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThan(Long value) {
addCriterion("dept_id <", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdLessThanOrEqualTo(Long value) {
addCriterion("dept_id <=", value, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdIn(List<Long> values) {
addCriterion("dept_id in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotIn(List<Long> values) {
addCriterion("dept_id not in", values, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdBetween(Long value1, Long value2) {
addCriterion("dept_id between", value1, value2, "deptId");
return (Criteria) this;
}
public Criteria andDeptIdNotBetween(Long value1, Long value2) {
addCriterion("dept_id not between", value1, value2, "deptId");
return (Criteria) this;
}
}
public static class Criteria extends GeneratedCriteria {

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

@ -581,6 +581,7 @@ public class DockServiceImpl implements DockService {
List<SysDept> sysDepts = sysDeptMapper.selectDeptList(sysDept);
if (CollUtil.isNotEmpty(sysDepts)) {
deptName = sysDepts.get(0).getDeptName();
deptId = sysDepts.get(0).getDeptId();
}
}
@ -628,6 +629,7 @@ public class DockServiceImpl implements DockService {
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBody.setDepartment(deptName);
pmsPatientBody.setDeptId(deptId);
pmsPatientBodyMapper.updateByPrimaryKeySelective(pmsPatientBody);
} else {
pmsPatientBody = new PmsPatientBody();
@ -635,6 +637,7 @@ public class DockServiceImpl implements DockService {
pmsPatientBody.setPatientId(pmsPatient.getId());
disposePmsPatientBody(dockPatientVisitInfo, pmsPatientBody);
pmsPatientBody.setDepartment(deptName);
pmsPatientBody.setDeptId(deptId);
pmsPatientBodyMapper.insertSelective(pmsPatientBody);
}
return pmsPatientBody;

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

@ -49,6 +49,7 @@
<result column="diagnosis_date" jdbcType="VARCHAR" property="diagnosisDate" />
<result column="bmi" jdbcType="VARCHAR" property="bmi" />
<result column="visit_type" jdbcType="VARCHAR" property="visitType" />
<result column="dept_id" jdbcType="BIGINT" property="deptId" />
</resultMap>
<sql id="Example_Where_Clause">
<where>
@ -115,7 +116,7 @@
admission_method, admission_method_other, bed_number, discharge_date, discharge_method,
tz, temperature, systolic_pressure, diastolic_pressure, pulse, creatinine, oxygen_saturation,
albumin, total_protein, vitamin_d3, hematocrit, dimer, diagnosis_type, is_main_diagnosis,
diagnosis_code, diagnosis_name, diagnosis_date, bmi, visit_type
diagnosis_code, diagnosis_name, diagnosis_date, bmi, visit_type, dept_id
</sql>
<select id="selectByExample" parameterType="com.ccsens.system.domain.po.PmsPatientBodyExample" resultMap="BaseResultMap">
select
@ -164,7 +165,7 @@
vitamin_d3, hematocrit, dimer,
diagnosis_type, is_main_diagnosis, diagnosis_code,
diagnosis_name, diagnosis_date, bmi,
visit_type)
visit_type, dept_id)
values (#{id,jdbcType=BIGINT}, #{patientId,jdbcType=BIGINT}, #{height,jdbcType=VARCHAR},
#{weight,jdbcType=VARCHAR}, #{waistline,jdbcType=VARCHAR}, #{bloodPressureShrink,jdbcType=VARCHAR},
#{bloodPressureDiastole,jdbcType=VARCHAR}, #{restingHeartRate,jdbcType=VARCHAR},
@ -181,7 +182,7 @@
#{vitaminD3,jdbcType=VARCHAR}, #{hematocrit,jdbcType=VARCHAR}, #{dimer,jdbcType=VARCHAR},
#{diagnosisType,jdbcType=VARCHAR}, #{isMainDiagnosis,jdbcType=VARCHAR}, #{diagnosisCode,jdbcType=VARCHAR},
#{diagnosisName,jdbcType=VARCHAR}, #{diagnosisDate,jdbcType=VARCHAR}, #{bmi,jdbcType=VARCHAR},
#{visitType,jdbcType=VARCHAR})
#{visitType,jdbcType=VARCHAR}, #{deptId,jdbcType=BIGINT})
</insert>
<insert id="insertSelective" parameterType="com.ccsens.system.domain.po.PmsPatientBody">
insert into pms_patient_body
@ -327,6 +328,9 @@
<if test="visitType != null">
visit_type,
</if>
<if test="deptId != null">
dept_id,
</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">
@ -470,6 +474,9 @@
<if test="visitType != null">
#{visitType,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
#{deptId,jdbcType=BIGINT},
</if>
</trim>
</insert>
<select id="countByExample" parameterType="com.ccsens.system.domain.po.PmsPatientBodyExample" resultType="java.lang.Long">
@ -622,6 +629,9 @@
<if test="record.visitType != null">
visit_type = #{record.visitType,jdbcType=VARCHAR},
</if>
<if test="record.deptId != null">
dept_id = #{record.deptId,jdbcType=BIGINT},
</if>
</set>
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
@ -675,7 +685,8 @@
diagnosis_name = #{record.diagnosisName,jdbcType=VARCHAR},
diagnosis_date = #{record.diagnosisDate,jdbcType=VARCHAR},
bmi = #{record.bmi,jdbcType=VARCHAR},
visit_type = #{record.visitType,jdbcType=VARCHAR}
visit_type = #{record.visitType,jdbcType=VARCHAR},
dept_id = #{record.deptId,jdbcType=BIGINT}
<if test="_parameter != null">
<include refid="Update_By_Example_Where_Clause" />
</if>
@ -821,6 +832,9 @@
<if test="visitType != null">
visit_type = #{visitType,jdbcType=VARCHAR},
</if>
<if test="deptId != null">
dept_id = #{deptId,jdbcType=BIGINT},
</if>
</set>
where id = #{id,jdbcType=BIGINT}
</update>
@ -871,7 +885,8 @@
diagnosis_name = #{diagnosisName,jdbcType=VARCHAR},
diagnosis_date = #{diagnosisDate,jdbcType=VARCHAR},
bmi = #{bmi,jdbcType=VARCHAR},
visit_type = #{visitType,jdbcType=VARCHAR}
visit_type = #{visitType,jdbcType=VARCHAR},
dept_id = #{deptId,jdbcType=BIGINT}
where id = #{id,jdbcType=BIGINT}
</update>
</mapper>

59
ruisi_java/ruisi-web-client/src/main/resources/mapper/dao/PmsPatientDao.xml

@ -24,64 +24,6 @@
</delete>
<select id="queryPatientList" resultType="com.ccsens.system.domain.vo.PmsPatientVo$PatientList">
SELECT
DISTINCT
pp.id as patientId,
pp.`name` as patientName,
pp.sex,
pp.idcard,
pp.mobile as phone,
pp.birth_year as birthYear,
pp.birthday,
pp.belief,
pp.hobby,
pp.contact_name as contactName,
pp.contact_relation as contactRelation,
pp.contact_mobile as contactMobile,
pp.contact_other as contactOther,
pp.id_card_type as idCardType,
pp.id_card_type_other as idCardTypeOther,
pp.abo_blood_type as aboBloodType,
pp.rh_blood_type as rhBloodType,
MAX(ae.create_time) as lastEvaluationTime,
uu.nick_name as lastTesterName,
COUNT(ae.id) as evaluationCount,
(select nick_name from ums_user where user_name = pp.create_by and del_flag = 0) as creatorName,
pp.create_time as createTime
FROM
pms_patient pp
LEFT JOIN ems_evaluation ae on pp.id = ae.patient_id
LEFT JOIN ums_user uu on pp.create_by = uu.user_name
left join pms_patient_body pb on pp.id = pb.patient_id
WHERE
pp.del_flag = 0
<if test="searchValue != null and searchValue != ''">
and (
pp.name like CONCAT('%',#{searchValue},'%')
or
pp.name_initial like CONCAT('%',LOWER(#{searchValue}),'%')
or
pp.name_full like CONCAT('%',LOWER(#{searchValue}),'%')
or
pp.idcard like CONCAT('%',#{searchValue},'%')
or
pb.outpatient_no like CONCAT('%',#{searchValue},'%')
)
</if>
<if test="idcard != null and idcard != ''">
and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt})
</if>
<!-- 权限 总测评师和测评师都是本部门及以下 -->
and uu.dept_id IN ( SELECT d.dept_id FROM ums_user u LEFT JOIN ums_dept d on (d.dept_id = u.dept_id or FIND_IN_SET(u.dept_id,ancestors))
WHERE user_id = #{userId}
)
GROUP BY pp.id
order by pp.create_time desc
SELECT
pp.id as patientId,
pp.`name` as patientName,
@ -146,7 +88,6 @@
u.user_id = #{userId})
)
)
GROUP BY pp.id
order by pp.create_time desc
</select>

Loading…
Cancel
Save