From afb7d9a8ddb49a83ed5e862f718de7b06342f92e Mon Sep 17 00:00:00 2001 From: ccsens_zhengzhichuan Date: Fri, 13 Mar 2026 17:52:43 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E6=8A=A5=E5=91=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../system/persist/dao/StatisticsDao.java | 62 +++- .../system/service/StatisticsService.java | 30 +- .../service/impl/StatisticsServiceImpl.java | 70 ++-- .../resources/mapper/dao/StatisticsDao.xml | 141 +++++-- .../admin/controller/RmsController.java | 14 +- .../controller/StatisticsController.java | 349 ++++++++++++------ .../admin/controller/TjfxController.java | 308 ++++++++-------- .../com/ccsens/admin/persist/dao/RmsDao.java | 2 +- .../admin/service/impl/RmsServiceImpl.java | 23 +- .../src/main/resources/mapper/dao/RmsDao.xml | 94 +++-- 10 files changed, 674 insertions(+), 419 deletions(-) diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java index dc92dcd..9033170 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/persist/dao/StatisticsDao.java @@ -16,78 +16,104 @@ public interface StatisticsDao { /** * 综合数据 + * * @param dto * @return */ - HomeDpVo.Zhsjgl nntotal(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.Zhsjgl nntotal(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); Integer getPatientNum(@Param("dto") StatisticsDto.Query dto, - @Param("sex") Byte sex); + @Param("sex") Byte sex, + @Param("deptIdLIst") List deptIdLIst); /** * BMI + * * @param dto * @return */ - HomeDpVo.Bmi nnbmihjxy(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.Bmi nnbmihjxy(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * 最新评估情况 + * * @param dto * @return */ - List nnlast(@Param("dto") StatisticsDto.Query dto); + List nnlast(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * 年龄分布 + * * @param dto * @return */ - HomeDpVo.Nlfb nnage(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.Nlfb nnage(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * T值分析 + * * @param dto * @return */ - HomeDpVo.Tz nntgb(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.Tz nntgb(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - HomeDpVo.Ypzb nnYpzb(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.Ypzb nnYpzb(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * 疾病排行 + * * @param dto * @return */ - List nnicd(@Param("dto") StatisticsDto.Query dto); + List nnicd(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * 地图 + * * @param dto * @return */ - List nnmap(@Param("dto") StatisticsDto.Query dto); + List nnmap(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); /** * 评估结果 + * * @param dto * @return */ - List nnscale(@Param("dto") StatisticsDto.Query dto); + List nnscale(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - List qualificationStatistics(@Param("dto") StatisticsDto.Query dto); + List qualificationStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto); + HomeDpVo.JzStatistics JzStatistics(@Param("param") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.JzStatistics JzStatisticsNum(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - List scaleStatistics(@Param("dto") StatisticsDto.Query dto); + List scaleStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - List versionStatistics(@Param("dto") StatisticsDto.Query dto); + List versionStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - List userStatistics(@Param("dto") StatisticsDto.Query dto); + List userStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - HomeDpVo.SexStatistics sexStatistics(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.SexStatistics sexStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); - HomeDpVo.XyYjStatistics xyYjStatistics(@Param("dto") StatisticsDto.Query dto); + HomeDpVo.XyYjStatistics xyYjStatistics(@Param("dto") StatisticsDto.Query dto, + @Param("deptIdLIst") List deptIdLIst); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java index c16bc8f..b996007 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/StatisticsService.java @@ -14,32 +14,32 @@ import java.util.List; */ public interface StatisticsService { - HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto); + HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto, List deptIdLIst); - HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto); - List nnlast(StatisticsDto.Query dto); - HomeDpVo.Nlfb nnage(StatisticsDto.Query dto); - HomeDpVo.Tz nntgb(StatisticsDto.Query dto); - List nnicd(StatisticsDto.Query dto); - List nnmap(StatisticsDto.Query dto); - List nnscale(StatisticsDto.Query dto); + HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto, List deptIdLIst); + List nnlast(StatisticsDto.Query dto, List deptIdLIst); + HomeDpVo.Nlfb nnage(StatisticsDto.Query dto, List deptIdLIst); + HomeDpVo.Tz nntgb(StatisticsDto.Query dto, List deptIdLIst); + List nnicd(StatisticsDto.Query dto, List deptIdLIst); + List nnmap(StatisticsDto.Query dto, List deptIdLIst); + List nnscale(StatisticsDto.Query dto, List deptIdLIst); /** * 学历统计 * @param dto * @return */ - List qualificationStatistics(StatisticsDto.Query dto); + List qualificationStatistics(StatisticsDto.Query dto, List deptIdLIst); - HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto); + HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto, List deptIdLIst); - List scaleStatistics(StatisticsDto.Query dto); + List scaleStatistics(StatisticsDto.Query dto, List deptIdLIst); - List versionStatistics(StatisticsDto.Query dto); + List versionStatistics(StatisticsDto.Query dto, List deptIdLIst); - List userStatistics(StatisticsDto.Query dto); + List userStatistics(StatisticsDto.Query dto, List deptIdLIst); - HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto); + HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto, List deptIdLIst); - HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto); + HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto, List deptIdLIst); } diff --git a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java index e84aed1..25e12ee 100644 --- a/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java +++ b/ruisi_java/ruisi-system/src/main/java/com/ccsens/system/service/impl/StatisticsServiceImpl.java @@ -26,112 +26,112 @@ public class StatisticsServiceImpl implements StatisticsService { private StatisticsDao statisticsDao; @Override - public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto) { + public HomeDpVo.Zhsjgl nntotal(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - HomeDpVo.Zhsjgl nntotal = statisticsDao.nntotal(dto); + HomeDpVo.Zhsjgl nntotal = statisticsDao.nntotal(dto, deptIdLIst); if (nntotal == null) { nntotal = new HomeDpVo.Zhsjgl(); } - nntotal.setPtotal(statisticsDao.getPatientNum(dto, null)); - nntotal.setMtotal(statisticsDao.getPatientNum(dto, (byte) 0)); - nntotal.setFtotal(statisticsDao.getPatientNum(dto, (byte) 1)); + nntotal.setPtotal(statisticsDao.getPatientNum(dto, null, deptIdLIst)); + nntotal.setMtotal(statisticsDao.getPatientNum(dto, (byte) 0, deptIdLIst)); + nntotal.setFtotal(statisticsDao.getPatientNum(dto, (byte) 1, deptIdLIst)); return nntotal; } @Override - public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto) { + public HomeDpVo.Bmi nnbmihjxy(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnbmihjxy(dto); + return statisticsDao.nnbmihjxy(dto, deptIdLIst); } @Override - public List nnlast(StatisticsDto.Query dto) { + public List nnlast(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnlast(dto); + return statisticsDao.nnlast(dto, deptIdLIst); } @Override - public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto) { + public HomeDpVo.Nlfb nnage(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnage(dto); + return statisticsDao.nnage(dto, deptIdLIst); } @Override - public HomeDpVo.Tz nntgb(StatisticsDto.Query dto) { + public HomeDpVo.Tz nntgb(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nntgb(dto); + return statisticsDao.nntgb(dto, deptIdLIst); } @Override - public List nnicd(StatisticsDto.Query dto) { + public List nnicd(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnicd(dto); + return statisticsDao.nnicd(dto, deptIdLIst); } @Override - public List nnmap(StatisticsDto.Query dto) { + public List nnmap(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnmap(dto); + return statisticsDao.nnmap(dto, deptIdLIst); } @Override - public List nnscale(StatisticsDto.Query dto) { + public List nnscale(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.nnscale(dto); + return statisticsDao.nnscale(dto, deptIdLIst); } @Override - public List qualificationStatistics(StatisticsDto.Query dto) { + public List qualificationStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.qualificationStatistics(dto); + return statisticsDao.qualificationStatistics(dto, deptIdLIst); } @Override - public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto) { + public HomeDpVo.JzStatistics jzStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } -// HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto); +// HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatisticsNum(dto, deptIdLIst); // if (jzStatistics!= null) { - HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto); + HomeDpVo.JzStatistics jzStatistics = statisticsDao.JzStatistics(dto, deptIdLIst); // jzStatistics.setZyNum(jzStatistics1.getZyNum()); // jzStatistics.setMzNum(jzStatistics1.getMzNum()); // } @@ -139,37 +139,37 @@ public class StatisticsServiceImpl implements StatisticsService { } @Override - public List scaleStatistics(StatisticsDto.Query dto) { + public List scaleStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.scaleStatistics(dto); + return statisticsDao.scaleStatistics(dto, deptIdLIst); } @Override - public List versionStatistics(StatisticsDto.Query dto) { + public List versionStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.versionStatistics(dto); + return statisticsDao.versionStatistics(dto, deptIdLIst); } @Override - public List userStatistics(StatisticsDto.Query dto) { + public List userStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); dto.setEndTime(dateByType.get(1)); } - return statisticsDao.userStatistics(dto); + return statisticsDao.userStatistics(dto, deptIdLIst); } @Override - public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto) { + public HomeDpVo.SexStatistics sexStatistics(StatisticsDto.Query dto, List deptIdLIst) { if (dto.getTimeType() != null) { List dateByType = getDateByType(dto.getTimeType(), dto.getBeginTime()); dto.setBeginTime(dateByType.get(0)); @@ -177,15 +177,15 @@ public class StatisticsServiceImpl implements StatisticsService { } HomeDpVo.SexStatistics sexStatistics = new HomeDpVo.SexStatistics(); - sexStatistics.setBoy(statisticsDao.getPatientNum(dto, (byte) 0)); - sexStatistics.setGirl(statisticsDao.getPatientNum(dto, (byte) 1)); + sexStatistics.setBoy(statisticsDao.getPatientNum(dto, (byte) 0, deptIdLIst)); + sexStatistics.setGirl(statisticsDao.getPatientNum(dto, (byte) 1, deptIdLIst)); return sexStatistics; } @Override - public HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto) { - return statisticsDao.xyYjStatistics(dto); + public HomeDpVo.XyYjStatistics xyYjStatistics(StatisticsDto.Query dto, List deptIdLIst) { + return statisticsDao.xyYjStatistics(dto, deptIdLIst); } /** diff --git a/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml b/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml index 382b074..2f83260 100644 --- a/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml +++ b/ruisi_java/ruisi-system/src/main/resources/mapper/dao/StatisticsDao.xml @@ -14,15 +14,18 @@ ems_evaluation e LEFT JOIN ums_user u ON e.create_by = u.user_name where e.del_flag = 0 and e.complete_status != 0 - - AND u.dept_id = #{dto.deptId} - AND e.create_time >= #{dto.beginTime} AND e.create_time <= #{dto.endTime} + + AND u.dept_id IN + + #{item} + + SELECT - rr.id as evaluationId, + rr.id as reportId, + ee.id as evaluationId, pp.name, pp.sex, pb.outpatient_no as outpatientNo, @@ -1024,8 +1025,8 @@ d.dept_name as hospitalName FROM rms_report rr Left Join pms_patient_body pb on rr.visit_no = pb.outpatient_no and pb.del_flag = 0 - LEFT JOIN pms_patient pp on pb.patient_id = pp.id left join ems_evaluation ee on rr.evaluation_id = ee.id + LEFT JOIN pms_patient pp on ee.patient_id = pp.id LEFT JOIN hms_version hv on ee.version = hv.id LEFT JOIN ums_user uu on ee.tester_id = uu.user_id LEFT JOIN ems_evaluation_scale_relevance e on e.evaluation_id = ee.id and e.del_flag = 0 @@ -1499,47 +1500,60 @@ d.dept_name as hospitalName - SELECT - DISTINCT - pp.id as patientId, - pp.`name` as patientName, + SELECT DISTINCT + a.patientId, + a.patientName, + a.sex, + a.idcard, + a.phone, -- 核心修复:将 a.mobile 改为 a.phone(与内层别名一致) + a.educationalStatus, + a.independentLivingSkills, + a.birthNumber, + a.dwellingState, + a.lastEvaluationTime, + a.lastTesterName, -- 修正之前的笔误(原 astTesterName) + a.evaluationCount, + a.createBy, + a.createTime, + a.hospitalName, + a.birthday, + a.career, + a.maritalStatus, + a.domicile, + a.nation, + a.nativePlace, + a.contactName, + a.contactRelation, + a.contactMobile, + a.address, + a.belief, + a.hobby, + a.aboBloodType, + a.rhBloodType + FROM + ( + SELECT DISTINCT + pp.id AS patientId, + pp.`name` AS patientName, pp.sex, --- pp.age, pp.idcard, - pp.mobile as phone, - pp.educational_status as educationalStatus, - pp.independent_living_skills as independentLivingSkills, - pp.birth_number as birthNumber, - pp.dwelling_state as dwellingState, - MAX(ee.create_time) as lastEvaluationTime, - uu.nick_name as lastTesterName, - COUNT(ee.id) as evaluationCount, - (select nick_name from ums_user where user_name = pp.create_by and del_flag = 0) as createBy, - pp.create_time as createTime, - ud.dept_name as hospitalName, + pp.mobile AS phone, -- 内层别名是 phone + pp.educational_status AS educationalStatus, + pp.independent_living_skills AS independentLivingSkills, + pp.birth_number AS birthNumber, + pp.dwelling_state AS dwellingState, + MAX(ee.create_time) AS lastEvaluationTime, + uu.nick_name AS lastTesterName, + COUNT(ee.id) AS evaluationCount, + (SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy, + pp.create_time AS createTime, + ud.dept_name AS hospitalName, pp.birthday, pp.career, - pp.marital_status as maritalStatus, + pp.marital_status AS maritalStatus, pp.domicile, pp.nation, - pp.native_place as nativePlace, - pp.contact_name as contactName, - pp.contact_relation as contactRelation, - pp.contact_mobile as contactMobile, + pp.native_place AS nativePlace, + pp.contact_name AS contactName, + pp.contact_relation AS contactRelation, + pp.contact_mobile AS contactMobile, pp.address, pp.belief, pp.hobby, - pp.abo_blood_type as aboBloodType, - pp.rh_blood_type as rhBloodType + pp.abo_blood_type AS aboBloodType, + pp.rh_blood_type AS rhBloodType FROM pms_patient pp - LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id and ee.del_flag = 0 + LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0 LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id - left join pms_patient_body pb on pp.id = pb.patient_id - LEFT JOIN ums_user uu1 ON pp.create_by = uu1.user_name WHERE pp.del_flag = 0 + + + and pp.hospital_id IN + + #{item} + + + and ( pp.name like CONCAT('%',#{param.searchValue},'%') @@ -138,13 +174,13 @@ and pp.hospital_id = #{param.hospitalId} - + and pp.sex = #{param.sex} - and pp.hospital_id = #{param.deptId} + and pp.hospital_id = #{param.deptId} - + and pp.educational_status = #{param.educationalStatus} @@ -171,43 +207,112 @@ - - + GROUP BY + pp.id + UNION ALL + SELECT DISTINCT + pp.id AS patientId, + pp.`name` AS patientName, + pp.sex, + pp.idcard, + pp.mobile AS phone, -- 内层别名统一为 phone + pp.educational_status AS educationalStatus, + pp.independent_living_skills AS independentLivingSkills, + pp.birth_number AS birthNumber, + pp.dwelling_state AS dwellingState, + MAX(ee.create_time) AS lastEvaluationTime, + uu.nick_name AS lastTesterName, + COUNT(ee.id) AS evaluationCount, + (SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy, + pp.create_time AS createTime, + ud.dept_name AS hospitalName, + pp.birthday, + pp.career, + pp.marital_status AS maritalStatus, + pp.domicile, + pp.nation, + pp.native_place AS nativePlace, + pp.contact_name AS contactName, + pp.contact_relation AS contactRelation, + pp.contact_mobile AS contactMobile, + pp.address, + pp.belief, + pp.hobby, + pp.abo_blood_type AS aboBloodType, + pp.rh_blood_type AS rhBloodType + FROM + pms_patient pp + LEFT JOIN pms_patient_body pb ON pb.patient_id = pp.id AND pb.del_flag = 0 + LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0 + LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id + LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id + WHERE + pp.del_flag = 0 + 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} - ) - or - uu1.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} - ) + pp.name like CONCAT('%',#{param.searchValue},'%') + or + pp.name_initial like CONCAT('%',LOWER(#{param.searchValue}),'%') + or + pp.name_full like CONCAT('%',LOWER(#{param.searchValue}),'%') + or + pp.idcard like CONCAT('%',#{param.searchValue},'%') ) - - - - - - - - - - - - - - - - - - - - GROUP BY pp.id - order by pp.create_time desc + + and date_format(pp.create_time,'%y%m%d') >= date_format(#{param.beginTime},'%y%m%d') + + + and date_format(pp.create_time,'%y%m%d') <= date_format(#{param.endTime},'%y%m%d') + + + and pp.hospital_id = #{param.hospitalId} + + + and pp.sex = #{param.sex} + + + and pp.hospital_id = #{param.deptId} + + + and pp.educational_status = #{param.educationalStatus} + + + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) < 60 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 60 AND 69 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 70 AND 79 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) BETWEEN 80 AND 89 + + + and (TIMESTAMPDIFF(YEAR, pp.birthday, CURDATE()) - + (DATE_FORMAT(CURDATE(), '%m%d') < DATE_FORMAT(pp.birthday, '%m%d'))) >= 90 + + + + + + and pp.hospital_id IN + + #{item} + + + + GROUP BY + pp.id + ) a + ORDER BY a.createTime DESC - SELECT - DISTINCT - pp.id as patientId, - pp.`name` as patientName, + SELECT DISTINCT + a.patientId, + a.patientName, + a.sex, + a.idcard, + a.phone, -- 核心修复:将 a.mobile 改为 a.phone(与内层别名一致) + a.educationalStatus, + a.independentLivingSkills, + a.birthNumber, + a.dwellingState, + a.lastEvaluationTime, + a.lastTesterName, -- 修正之前的笔误(原 astTesterName) + a.evaluationCount, + a.createBy, + a.createTime, + a.hospitalName, + a.birthday, + a.career, + a.maritalStatus, + a.domicile, + a.nation, + a.nativePlace, + a.contactName, + a.contactRelation, + a.contactMobile, + a.address, + a.belief, + a.hobby, + a.aboBloodType, + a.rhBloodType + FROM + ( + SELECT DISTINCT + pp.id AS patientId, + pp.`name` AS patientName, pp.sex, pp.idcard, - pp.mobile as phone, - pp.birth_year as birthYear, + pp.mobile AS phone, -- 内层别名是 phone + pp.educational_status AS educationalStatus, + pp.independent_living_skills AS independentLivingSkills, + pp.birth_number AS birthNumber, + pp.dwelling_state AS dwellingState, + MAX(ee.create_time) AS lastEvaluationTime, + uu.nick_name AS lastTesterName, + COUNT(ee.id) AS evaluationCount, + (SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy, + pp.create_time AS createTime, + ud.dept_name AS hospitalName, pp.birthday, + pp.career, + pp.marital_status AS maritalStatus, + pp.domicile, + pp.nation, + pp.native_place AS nativePlace, + pp.contact_name AS contactName, + pp.contact_relation AS contactRelation, + pp.contact_mobile AS contactMobile, + pp.address, 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 + pp.abo_blood_type AS aboBloodType, + pp.rh_blood_type AS rhBloodType 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 + LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0 + LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id + LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id WHERE pp.del_flag = 0 + + + and pp.hospital_id IN + + #{item} + + + and ( pp.name like CONCAT('%',#{searchValue},'%') @@ -68,42 +115,81 @@ pb.outpatient_no like CONCAT('%',#{searchValue},'%') ) - - and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt}) - - - 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 + + and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt}) + + GROUP BY + pp.id + UNION ALL + SELECT DISTINCT + pp.id AS patientId, + pp.`name` AS patientName, + pp.sex, + pp.idcard, + pp.mobile AS phone, -- 内层别名统一为 phone + pp.educational_status AS educationalStatus, + pp.independent_living_skills AS independentLivingSkills, + pp.birth_number AS birthNumber, + pp.dwelling_state AS dwellingState, + MAX(ee.create_time) AS lastEvaluationTime, + uu.nick_name AS lastTesterName, + COUNT(ee.id) AS evaluationCount, + (SELECT nick_name FROM ums_user WHERE user_name = pp.create_by AND del_flag = 0) AS createBy, + pp.create_time AS createTime, + ud.dept_name AS hospitalName, + pp.birthday, + pp.career, + pp.marital_status AS maritalStatus, + pp.domicile, + pp.nation, + pp.native_place AS nativePlace, + pp.contact_name AS contactName, + pp.contact_relation AS contactRelation, + pp.contact_mobile AS contactMobile, + pp.address, + pp.belief, + pp.hobby, + pp.abo_blood_type AS aboBloodType, + pp.rh_blood_type AS rhBloodType + FROM + pms_patient pp + LEFT JOIN pms_patient_body pb ON pb.patient_id = pp.id AND pb.del_flag = 0 + LEFT JOIN ems_evaluation ee ON pp.id = ee.patient_id AND ee.del_flag = 0 + LEFT JOIN ums_user uu ON ee.tester_id = uu.user_id + LEFT JOIN ums_dept ud ON pp.hospital_id = ud.dept_id + WHERE + pp.del_flag = 0 + + 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},'%') + ) + + + and (pp.idcard = #{idcard} or pp.idcard = #{idcardEncrypt}) + + + + and pp.hospital_id IN + + #{item} + + + + GROUP BY + pp.id + ) a + ORDER BY a.createTime DESC + + From fa305e762ede1ca886348b7bad9f0efffd807dbe Mon Sep 17 00:00:00 2001 From: lzp <1747191978@qq.com> Date: Sun, 15 Mar 2026 10:32:07 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E5=B0=B1=E8=AF=8A=E5=8F=B7=E4=B8=8D?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E6=95=B0=E5=AD=97=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_client/src/views/evaluation/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_client/src/views/evaluation/index.vue b/web_client/src/views/evaluation/index.vue index e455151..0da01aa 100644 --- a/web_client/src/views/evaluation/index.vue +++ b/web_client/src/views/evaluation/index.vue @@ -26,7 +26,7 @@
就诊号 - + *
From a8361a9c2372822f23fa68cc77b63bd7ee5a1b17 Mon Sep 17 00:00:00 2001 From: lzp <1747191978@qq.com> Date: Sun, 15 Mar 2026 13:45:34 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=88=E5=A5=97=E9=A4=90=E9=80=89=E6=8B=A9=E9=A1=B9=E5=B1=82?= =?UTF-8?q?=E7=BA=A7=E5=A4=AA=E9=AB=98=EF=BC=8C=E5=AF=BC=E8=87=B4=E4=B8=8B?= =?UTF-8?q?=E4=B8=80=E6=AD=A5=E4=BC=9A=E9=80=89=E6=8B=A9=E5=A5=97=E9=A4=90?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/Patient/chooseSetMeal/index.vue | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/web_client/src/views/Patient/chooseSetMeal/index.vue b/web_client/src/views/Patient/chooseSetMeal/index.vue index 819977e..822a8d2 100644 --- a/web_client/src/views/Patient/chooseSetMeal/index.vue +++ b/web_client/src/views/Patient/chooseSetMeal/index.vue @@ -102,11 +102,10 @@ class="checkbox-group2-item" > -

+

+

{{ item2.scaleName }}({{ item2.questionNum || 0 }}) @@ -427,7 +426,7 @@ export default { if (row1.scaleList) { // console.log(row1.scaleList); let scaleCodeList = row1.scaleList.map( - (item) => item.scaleCode + (item) => item.scaleCode, ); this.checkboxGroup2 = [ ...this.checkboxGroup2, @@ -525,6 +524,8 @@ export default { evaluationId: this.createId, scaleList, }; + console.log("param", param); + let res = await bindScale(param); const { code, msg, data } = res; if (code === 200) { @@ -947,7 +948,7 @@ export default { right: 0; margin: 0 auto; bottom: 20px; - z-index: 9999; + z-index: 66; } .divul { display: flex; @@ -1047,6 +1048,7 @@ export default { border: 2px solid #5cc0be; margin: 5px; height: 58px; + position: relative; } .checkbox-group2 h2 { font-size: 22px; @@ -1060,7 +1062,7 @@ export default { left: 0px; right: 0px; height: 58px; - z-index: 8888; + z-index: 9999; } .div-scale-box { // border-top: 1px solid #e1e9f1; From 54242d5f750f3f74245749384cddcbab659c36c4 Mon Sep 17 00:00:00 2001 From: ccsens_zhengzhichuan Date: Mon, 16 Mar 2026 08:34:04 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=B0=B1=E8=AF=8A=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/controller/PmsController.java | 22 ++++++++++++++++++- .../admin/persist/dao/PmsPatientDao.java | 22 ++++++++++++++----- .../admin/service/IPmsPatientService.java | 3 ++- .../service/impl/PmsPatientServiceImpl.java | 6 ++--- .../resources/mapper/dao/PmsPatientDao.xml | 16 +++++++++----- 5 files changed, 53 insertions(+), 16 deletions(-) diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java index a2d3eef..5055b6d 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/controller/PmsController.java @@ -260,8 +260,28 @@ public class PmsController extends BaseController { dataScope = loginUser.getUser().getRoles().get(0).getDataScope(); } dto.getParam().setDeptId(loginUser.getDeptId()); + + + List deptIdList = new ArrayList<>(); + if (dto.getParam().getDeptId() == null) { + try { + deptIdList.addAll(sysPowerService.queryPowerDept()); + } catch (Exception e) { + log.info("获取当前登录用户部门错误"); + // 获取请求携带的令牌 + HttpServletRequest request = ((ServletRequestAttributes) + RequestContextHolder.getRequestAttributes()).getRequest(); + String deptId = request.getHeader(WebConstant.HEADER_KEY_DEPT_ID); + if (StrUtil.isNotEmpty(deptId)) { + deptIdList.add(Long.parseLong(deptId)); + } + } + }else { + deptIdList.add(dto.getParam().getDeptId()); + } + startPage(dto); - return JsonResponse.ok(new PageInfo<>(patientService.queryPatientJzList(dto.getParam(), dataScope, loginUser.getUserId(),loginUser.getUsername()))); + return JsonResponse.ok(new PageInfo<>(patientService.queryPatientJzList(dto.getParam(), dataScope, loginUser.getUserId(),loginUser.getUsername(), deptIdList))); } @ApiOperation("导出患者就诊列表") diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java index b3263f3..0244248 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/persist/dao/PmsPatientDao.java @@ -14,25 +14,35 @@ public interface PmsPatientDao extends PmsPatientMapper { List queryPatientList(@Param("param") PmsPatientDto.QueryPatient param, @Param("dataScope") String dataScope, @Param("userId") Long userId, - @Param("userName")String userName, - @Param("deptIdList")List deptIdList); + @Param("userName") String userName, + @Param("deptIdList") List deptIdList); - PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id")Long id); + PmsPatientVo.PatientInfo queryPatientEvaluationById(@Param("id") Long id); void deleteById(Long id); + void deletePatientAcpByPatientId(Long patientId); + void deletePatientBodyByPatientId(Long patientId); + void deletePatientFamilyIllnessByPatientId(Long patientId); + void deletePatientIllnessHistoryByPatientId(Long patientId); + void deletePatientParentIllnessByPatientId(Long patientId); + void deletePatientPersonalByPatientId(Long patientId); + void batchDeleteByIdCard(@Param("pmsPatientList") List pmsPatientList); + void batchInsert(@Param("pmsPatientList") List pmsPatientList); + void batchInsertTjbg(@Param("list") List list); List queryPatientJzList(@Param("param") PmsPatientDto.QueryPatientJz param, - @Param("dataScope") String dataScope, - @Param("userId") Long userId, - @Param("userName")String userName); + @Param("dataScope") String dataScope, + @Param("userId") Long userId, + @Param("userName") String userName, + @Param("deptIdList") List deptIdList); } diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java index 66f659a..532b1d6 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/IPmsPatientService.java @@ -64,7 +64,8 @@ public interface IPmsPatientService { List queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, - String userName); + String userName, + List deptIdList); void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException; diff --git a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java index de015b8..0bea350 100644 --- a/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java +++ b/ruisi_java/ruisi-web-admin/src/main/java/com/ccsens/admin/service/impl/PmsPatientServiceImpl.java @@ -2217,8 +2217,8 @@ public class PmsPatientServiceImpl implements IPmsPatientService { } @Override - public List queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) { - List queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName); + public List queryPatientJzList(PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName, List deptIdList) { + List queryPatientJzs = patientDao.queryPatientJzList(param, dataScope, SecurityUtils.isAdmin(userId) ? null : userId, userName, deptIdList); if (CollUtil.isNotEmpty(queryPatientJzs)) { for (PmsPatientVo.QueryPatientJz queryPatientJz : queryPatientJzs) { //查询就诊 @@ -2273,7 +2273,7 @@ public class PmsPatientServiceImpl implements IPmsPatientService { @Override public void exportPatientJz(HttpServletResponse response, PmsPatientDto.QueryPatientJz param, String dataScope, Long userId, String userName) throws IOException { - List queryPatientJzs = queryPatientJzList(param, dataScope, userId, userName); + List queryPatientJzs = queryPatientJzList(param, dataScope, userId, userName, null); if (CollUtil.isEmpty(queryPatientJzs)) { throw new BaseException("没有数据"); } diff --git a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml index 555c044..19157df 100644 --- a/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml +++ b/ruisi_java/ruisi-web-admin/src/main/resources/mapper/dao/PmsPatientDao.xml @@ -440,14 +440,20 @@ and b.diagnosis_code like concat('%',#{param.diagnosisCode},'%') - + - 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} + and (uu.dept_id IN + + #{item} + + or + b.dept_id IN + + #{item} + ) + order by b.id desc From b7c821866e5a957059e027f98ee57518abf3d745 Mon Sep 17 00:00:00 2001 From: lzp <1747191978@qq.com> Date: Mon, 16 Mar 2026 08:50:05 +0800 Subject: [PATCH 7/8] =?UTF-8?q?pdf=E5=BC=95=E5=85=A5=E8=B7=AF=E5=BE=84?= =?UTF-8?q?=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web_admin/src/views/report/view copy.vue | 2 +- web_admin/vue.config.js | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/web_admin/src/views/report/view copy.vue b/web_admin/src/views/report/view copy.vue index 70c62e3..ba38c05 100644 --- a/web_admin/src/views/report/view copy.vue +++ b/web_admin/src/views/report/view copy.vue @@ -9,7 +9,7 @@