ruoyi-admin/src/main/java/com/ruoyi/web/controller/smartor/PatArchiveController.java
@@ -273,14 +273,14 @@ if (CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) || patArchiveReq.getLeaveldeptcodes().size() == 0) { patArchiveReq.setLeaveldeptcodes(null); } System.out.println("--------11111111:" + patArchiveReq); System.out.println("获取患者信息-入参patArchiveReq:" + patArchiveReq); List<PatArchiveOthreInfo> patientInfo = patArchiveService.getPatientInfoQC(patArchiveReq); System.out.println("--------222222:" + patientInfo.size()); System.out.println("获取患者信息-返回patientInfo:" + patientInfo.size()); patArchiveReq.setPageSize(null); patArchiveReq.setPageNum(null); List<PatArchiveOthreInfo> patientInfoQC = patArchiveService.getPatientInfoQC(patArchiveReq); return getDataTable3(patientInfoQC.size(), patientInfo); Long count = patArchiveService.getPatientInfoQCCount(patArchiveReq); return getDataTable3(count, patientInfo); } } ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysRoleController.java
@@ -94,7 +94,7 @@ //@PreAuthorize("@ss.hasPermi('system:role:add')") @Log(title = "角色管理", businessType = BusinessType.INSERT) @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/add") @PostMapping("/add") public AjaxResult add(@Validated @RequestBody SysRole role) { role.setOrgid(getLoginUser().getUser().getOrgid()); if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleNameUnique(role))) { @@ -112,8 +112,8 @@ */ //@PreAuthorize("@ss.hasPermi('system:role:edit')") @Log(title = "角色管理", businessType = BusinessType.UPDATE) @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/edit") @AddOrgId(field = "orgid", paramIndex = 0, campusField = "campusid") @PostMapping("/edit") public AjaxResult edit(@Validated @RequestBody SysRole role) { role.setOrgid(getLoginUser().getUser().getOrgid()); roleService.checkRoleAllowed(role); ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysDeptMapper.java
@@ -39,7 +39,7 @@ */ public SysDept selectDeptById(Long deptId); public SysDept selectDeptByCode(String deptCode); public SysDept selectDeptByCode(@Param("orgid") String orgid, @Param("deptCode") String deptCode); /** * 根据ID查询所有子部门 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysRoleMapper.java
@@ -62,18 +62,18 @@ /** * 校验角色名称是否唯一 * * @param roleName 角色名称 * @param role 角色 * @return 角色信息 */ public SysRole checkRoleNameUnique(String roleName); public SysRole checkRoleNameUnique(SysRole role); /** * 校验角色权限是否唯一 * * @param roleKey 角色权限 * @param role 角色 * @return 角色信息 */ public SysRole checkRoleKeyUnique(String roleKey); public SysRole checkRoleKeyUnique(SysRole role); /** * 修改角色信息 ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java
@@ -116,10 +116,10 @@ /** * 校验用户名称是否唯一 * * @param userName 用户名称 * @param user 用户名称 * @return 结果 */ public SysUser checkUserNameUnique(String userName); public SysUser checkUserNameUnique(SysUser user); /** * 校验手机号码是否唯一 ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysMenuServiceImpl.java
@@ -73,6 +73,8 @@ List<SysMenu> menuList = null; // 管理员显示所有菜单信息 // if (SysUser.isAdmin(userId)) { //menu 不限制 orgid,orgid都为空 menu.setOrgid(null); if (userId != null && isAdmin.contains(userId)) { menuList = menuMapper.selectMenuList(menu); } else { ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysRoleServiceImpl.java
@@ -150,7 +150,7 @@ public String checkRoleNameUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleNameUnique(role.getRoleName()); SysRole info = roleMapper.checkRoleNameUnique(role); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; @@ -168,7 +168,7 @@ public String checkRoleKeyUnique(SysRole role) { Long roleId = StringUtils.isNull(role.getRoleId()) ? -1L : role.getRoleId(); SysRole info = roleMapper.checkRoleKeyUnique(role.getRoleKey()); SysRole info = roleMapper.checkRoleKeyUnique(role); if (StringUtils.isNotNull(info) && info.getRoleId().longValue() != roleId.longValue()) { return UserConstants.NOT_UNIQUE; ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java
@@ -471,7 +471,7 @@ @Override public String checkUserNameUnique(SysUser user) { Long userId = StringUtils.isNull(user.getUserId()) ? -1L : user.getUserId(); SysUser info = userMapper.checkUserNameUnique(user.getUserName()); SysUser info = userMapper.checkUserNameUnique(user); if (StringUtils.isNotNull(info) && info.getUserId().longValue() != userId.longValue()) { return UserConstants.NOT_UNIQUE; } @@ -564,7 +564,7 @@ // } if (!CollectionUtils.isEmpty(user.getDeptCodes())) { for (String deptCode : user.getDeptCodes()) { SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode); SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), deptCode); if (ObjectUtils.isEmpty(sysDept)) { continue; } @@ -590,7 +590,7 @@ } if (!CollectionUtils.isEmpty(user.getWardCodes())) { for (String wardCode : user.getWardCodes()) { SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode); SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), wardCode); if (ObjectUtils.isEmpty(sysDept)) { continue; } @@ -673,7 +673,7 @@ // } if (!CollectionUtils.isEmpty(user.getDeptCodes())) { for (String deptCode : user.getDeptCodes()) { SysDept sysDept = sysDeptMapper.selectDeptByCode(deptCode); SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), deptCode); if (ObjectUtils.isEmpty(sysDept)) { continue; } @@ -699,7 +699,7 @@ } if (!CollectionUtils.isEmpty(user.getWardCodes())) { for (String wardCode : user.getWardCodes()) { SysDept sysDept = sysDeptMapper.selectDeptByCode(wardCode); SysDept sysDept = sysDeptMapper.selectDeptByCode(user.getOrgid(), wardCode); if (ObjectUtils.isEmpty(sysDept)) { continue; } ruoyi-system/src/main/resources/mapper/system/SysDeptMapper.xml
@@ -139,7 +139,11 @@ d.status from sys_dept d where del_flag = 0 and d.dept_code = #{deptCode} and d.dept_code = #{deptCode} <if test="orgid != null and orgid != ''"> and d.orgid = #{orgid} </if> limit 1 </select> <select id="checkDeptExistUser" parameterType="Long" resultType="int"> ruoyi-system/src/main/resources/mapper/system/SysRoleMapper.xml
@@ -99,14 +99,24 @@ WHERE r.del_flag = '0' and u.user_name = #{userName} </select> <select id="checkRoleNameUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleNameUnique" parameterType="com.ruoyi.common.core.domain.entity.SysRole" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_name=#{roleName} and r.del_flag = '0' limit 1 where r.role_name=#{roleName} and r.del_flag = '0' <if test="orgid != null and orgid != ''"> and r.orgid = #{orgid} </if> limit 1 </select> <select id="checkRoleKeyUnique" parameterType="String" resultMap="SysRoleResult"> <select id="checkRoleKeyUnique" parameterType="com.ruoyi.common.core.domain.entity.SysRole" resultMap="SysRoleResult"> <include refid="selectRoleVo"/> where r.role_key=#{roleKey} and r.del_flag = '0' limit 1 where r.role_key=#{roleKey} and r.del_flag = '0' <if test="orgid != null and orgid != ''"> and r.orgid = #{orgid} </if> limit 1 </select> <insert id="insertRole" parameterType="SysRole" useGeneratedKeys="true" keyProperty="roleId"> ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml
@@ -322,11 +322,18 @@ where u.user_id = #{userId} </select> <select id="checkUserNameUnique" parameterType="String" resultMap="SysUserResult"> <select id="checkUserNameUnique" parameterType="com.ruoyi.common.core.domain.entity.SysUser" resultMap="SysUserResult"> select user_id, user_name from sys_user where user_name = #{userName} and del_flag = '0' limit 1 and del_flag = '0' <if test="orgid != null and orgid != ''"> and orgid = #{orgid} </if> <if test="campusid != null and campusid != ''"> and campusid = #{campusid} </if> limit 1 </select> <select id="checkPhoneUnique" parameterType="String" resultMap="SysUserResult"> smartor/src/main/java/com/smartor/mapper/PatArchiveMapper.java
@@ -86,6 +86,10 @@ public List<PatArchiveOthreInfo> selectPatArchiveInfoByPhysicalQC(PatArchiveReq patArchive); public Long countPatArchiveInfoByInhospQC(PatArchiveReq patArchive); public Long countPatArchiveInfoByOuthospQC(PatArchiveReq patArchive); public Long countPatArchiveInfoByPhysicalQC(PatArchiveReq patArchive); } smartor/src/main/java/com/smartor/mapper/PatArchivetagMapper.java
@@ -1,9 +1,12 @@ package com.smartor.mapper; import java.util.List; import java.util.Map; import com.smartor.domain.PatArchivetag; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; /** * 患者档案标签Mapper接口 @@ -62,4 +65,13 @@ * @return 结果 */ public int deletePatArchivetagByIds(Long[] ids); /** * 获取患者标签字符串 * * @param patIds 患者档案标签主键集合 * @return 结果 */ @MapKey("patid") public Map<Long,String> getTagsByPatIds(@Param("orgid") String orgid, @Param("patIds") List<Long> patIds); } smartor/src/main/java/com/smartor/mapper/ServiceSubtaskMapper.java
@@ -1,6 +1,7 @@ package com.smartor.mapper; import com.smartor.domain.*; import org.apache.ibatis.annotations.MapKey; import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Param; @@ -67,6 +68,14 @@ public Double selectTimelyRate(ServiceSubtask ServiceSubtask); /** * 随访及时率:应随访时间<实际随访时间 * * @param ServiceSubtask * @return */ @MapKey("groupKey") public Map<String, Double> selectTimelyRateBatch(ServiceSubtask ServiceSubtask); /** * 随访及时率详情 * * @param ServiceSubtask smartor/src/main/java/com/smartor/service/IPatArchiveService.java
@@ -97,4 +97,6 @@ public List<PatArchiveOthreInfo> getPatientInfo(PatArchiveReq patArchiveReq); public List<PatArchiveOthreInfo> getPatientInfoQC(PatArchiveReq patArchiveReq); public Long getPatientInfoQCCount(PatArchiveReq patArchiveReq); } smartor/src/main/java/com/smartor/service/impl/PatArchiveServiceImpl.java
@@ -66,6 +66,8 @@ @Autowired private RedisCache redisCache; @Autowired private PatArchivetagServiceImpl patArchivetagServiceImpl; /** @@ -799,8 +801,62 @@ patArchiveList.addAll(patArchives1); } } // //查询tagName // List<Long> patIds = patArchiveList.stream().map(PatArchiveOthreInfo::getId).distinct().collect(Collectors.toList()); // Map<Long, String> patTagMap= patArchivetagMapper.getTagsByPatIds(patArchiveReq.getOrgid(),patIds); // //装配tagName // if(ObjectUtils.isNotEmpty(patTagMap)){ // patArchiveList.forEach(patArchiveOthreInfo -> { // String tagName = patTagMap.get(patArchiveOthreInfo.getId()); // if(StringUtils.isNotEmpty(tagName)){ // patArchiveOthreInfo.setTag(tagName); // } // }); // } return patArchiveList; } /** * 获取患者信息(去重) * * @param patArchiveReq * @return */ // @Override /** * 获取患者信息总数(去重) * * @param patArchiveReq * @return */ @Override public Long getPatientInfoQCCount(PatArchiveReq patArchiveReq) { if (CollectionUtils.isEmpty(patArchiveReq.getLeavehospitaldistrictcodes()) || patArchiveReq.getLeavehospitaldistrictcodes().size() == 0) { patArchiveReq.setLeavehospitaldistrictcodes(null); } if (CollectionUtils.isEmpty(patArchiveReq.getLeaveldeptcodes()) || patArchiveReq.getLeaveldeptcodes().size() == 0) { patArchiveReq.setLeaveldeptcodes(null); } Long count = 0L; if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 1) { // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 patArchiveReq.setCry(0); count = patArchiveMapper.countPatArchiveInfoByInhospQC(patArchiveReq); } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 2) { // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 count = patArchiveMapper.countPatArchiveInfoByOuthospQC(patArchiveReq); } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 3) { // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 count = patArchiveMapper.countPatArchiveInfoByPhysicalQC(patArchiveReq); } else if (patArchiveReq.getAllhosp() != null && patArchiveReq.getAllhosp() == 4) { // 查看住院 1 查看门诊 2 查看体检 3 查看出院 4 patArchiveReq.setCry(1); count = patArchiveMapper.countPatArchiveInfoByInhospQC(patArchiveReq); } return count; } } smartor/src/main/java/com/smartor/service/impl/ServiceSubtaskServiceImpl.java
@@ -2230,24 +2230,25 @@ public List<ServiceSubtaskStatistic> getSfStatistics(ServiceSubtaskCountReq serviceSubtaskCountReq) { log.info("getSfStatistics的入参为:{}", serviceSubtaskCountReq); List<ServiceSubtaskStatistic> serviceSubtaskStatistics = new ArrayList<>(); // List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq); List<ServiceSubtask> rawData = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq); // 根据条件进行分组 Map<String, List<ServiceSubtask>> collect = new HashMap<>(); if (serviceSubtaskCountReq.getLeavehospitaldistrictcodes() != null && serviceSubtaskCountReq.getLeavehospitaldistrictcodes().size() > 0) { if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); } else { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown"))); collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getLeavehospitaldistrictname()).orElse("Unknown"))); } } else if (serviceSubtaskCountReq.getDeptcodes() != null && serviceSubtaskCountReq.getDeptcodes().size() > 0) { if (serviceSubtaskCountReq.getDrcode() != null && !serviceSubtaskCountReq.getDrcode().isEmpty()) { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDrname()).orElse("Unknown"))); } else { collect = serviceSubtaskMapper.getSfStatistics(serviceSubtaskCountReq).stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown"))); collect = rawData.stream().collect(Collectors.groupingBy(subtask -> Optional.ofNullable(subtask.getDeptname()).orElse("Unknown"))); } } for (List<ServiceSubtask> serviceSubtaskList : collect.values()) { if (CollectionUtils.isEmpty(serviceSubtaskList)) { @@ -2566,18 +2567,24 @@ } else { serviceSubtaskStatistic.setFollowUpRate("0.00%"); } //首次随访人工 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { //首次随访人工 (不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("1")) { serviceSubtaskStatistic.setManual(serviceSubtaskStatistic.getManual() + 1L); manualInfo.add(serviceSubtask); } //首次随访短信 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { //首次随访短信(不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("4")) { serviceSubtaskStatistic.setSms(serviceSubtaskStatistic.getSms() + 1L); smsInfo.add(serviceSubtask); } //首次随访微信 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { //首次随访微信(不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("5")) { serviceSubtaskStatistic.setWeChat(serviceSubtaskStatistic.getWeChat() + 1L); wechatInfo.add(serviceSubtask); } @@ -2613,18 +2620,24 @@ } else { serviceSubtaskStatistic.setFollowUpRateAgain("0.00%"); } //再次随访人工 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("1")) { //再次随访人工(不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("1")) { serviceSubtaskStatistic.setManualAgain(serviceSubtaskStatistic.getManualAgain() + 1L); manualAgainInfo.add(serviceSubtask); } //再次随访短信 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("4")) { //再次随访短信(不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("4")) { serviceSubtaskStatistic.setSmsAgain(serviceSubtaskStatistic.getSmsAgain() + 1L); smsAgainInfo.add(serviceSubtask); } //再次随访微信 if (serviceSubtask.getSendstate() != null && serviceSubtask.getPreachform().equals("5")) { //再次随访微信(不统计不执行) if (serviceSubtask.getSendstate() != null && !serviceSubtask.getSendstate().equals(4L) && serviceSubtask.getPreachform().equals("5")) { serviceSubtaskStatistic.setWeChatAgain(serviceSubtaskStatistic.getWeChatAgain() + 1L); wechatAgainInfo.add(serviceSubtask); } smartor/src/main/resources/mapper/smartor/PatArchiveMapper.xml
@@ -586,14 +586,10 @@ d.nurse_id, d.out_way_id, d.leavehospitaldistrictname AS leavehospitaldistrictname, d.leavehospitaldistrictcode AS leavehospitaldistrictcode, t.tagname d.leavehospitaldistrictcode AS leavehospitaldistrictcode FROM pat_med_inhosp d JOIN pat_archive a ON a.id = d.patid LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = d.patid where 1=1 and d.del_flag != 1 AND a.del_flag != 1 @@ -812,12 +808,8 @@ a.upload_time, a.filter_drname, a.filter_drcode, t.tagname, a.pattype from pat_med_physical d JOIN pat_archive a ON a.id = d.patid LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = d.patid where 1=1 and d.del_flag != 1 AND a.del_flag != 1 @@ -917,14 +909,10 @@ d.nurse_id, d.out_way_id, d.leavehospitaldistrictname AS leavehospitaldistrictname, d.leavehospitaldistrictcode AS leavehospitaldistrictcode, t.tagname d.leavehospitaldistrictcode AS leavehospitaldistrictcode FROM pat_med_inhosp d JOIN pat_archive a ON a.id = d.patid LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = d.patid where 1=1 and d.del_flag != 1 AND a.del_flag != 1 @@ -1054,12 +1042,8 @@ a.upload_time, a.filter_drname, a.filter_drcode, t.tagname, a.pattype from pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = d.patid where 1=1 and d.del_flag != 1 AND a.del_flag != 1 @@ -1149,12 +1133,8 @@ a.create_time, a.isupload, a.upload_time, t.tagname, a.pattype from pat_med_physical d JOIN pat_archive a ON a.id = d.patid LEFT JOIN ( SELECT patid, GROUP_CONCAT( tagname ) AS tagname FROM pat_archivetag where del_flag=0 GROUP BY patid ) t ON t.patid = d.patid where 1=1 and d.del_flag != 1 AND a.del_flag != 1 @@ -1197,4 +1177,130 @@ -- order by a.update_time desc <if test="pageSize != null and pageNum != null">limit ${pageSize} OFFSET ${pageNum}</if> </select> <!-- 住院患者总数统计(去重) --> <select id="countPatArchiveInfoByInhospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> SELECT COUNT(DISTINCT a.id) FROM pat_med_inhosp d JOIN pat_archive a ON a.id = d.patid WHERE 1=1 AND d.del_flag != 1 AND a.del_flag != 1 AND d.orgid = #{orgid} <if test="name != null and name != ''">AND a.name like concat('%', #{name}, '%')</if> <if test="idcardno != null and idcardno != ''">AND a.idcardno = #{idcardno}</if> <if test="pid != null and pid != ''">AND a.id = #{id}</if> <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> <if test="leaveicd10code != null and leaveicd10code != ''">AND d.leaveicd10code LIKE concat('%',#{leaveicd10code}, '%')</if> <if test="endtime != null">AND d.endtime = #{endtime}</if> <if test="drname != null and drname != ''">AND d.drname LIKE concat('%',#{drname}, '%')</if> <if test="drcode != null">AND d.drcode = #{drcode}</if> <if test="campusid != null">AND d.campusid = #{campusid}</if> <if test="allhosp != null and allhosp == 1 ">AND d.endtime is null</if> <if test="allhosp != null and allhosp == 4 ">AND d.endtime is not null</if> <if test="visitno != null and visitno != ''">AND d.inhospno = #{visitno}</if> <if test="deptname != null and deptname != ''">AND d.deptname LIKE concat('%', #{deptname}, '%')</if> <if test="leavediagname != null and leavediagname != ''">AND d.leavediagname LIKE concat('%',#{leavediagname}, '%')</if> <if test="leavehospitaldistrictcodes != null and leavehospitaldistrictcodes.size()>0"> AND d.leavehospitaldistrictcode IN <foreach collection="leavehospitaldistrictcodes" item="leavehospitaldistrictcode" open="(" separator="," close=")"> #{leavehospitaldistrictcode} </foreach> </if> <if test="leaveldeptcodes != null and leaveldeptcodes.size() > 0"> AND d.leaveldeptcode IN <foreach collection="leaveldeptcodes" item="leaveldeptcode" open="(" separator="," close=")"> #{leaveldeptcode} </foreach> </if> <if test="hospitaldistrictcodes != null and hospitaldistrictcodes.size()>0"> AND d.hospitaldistrictcode IN <foreach collection="hospitaldistrictcodes" item="hospitaldistrictcode" open="(" separator="," close=")"> #{hospitaldistrictcode} </foreach> </if> <if test="deptcodes != null and deptcodes.size() > 0"> AND d.deptcode IN <foreach collection="deptcodes" item="deptcode" open="(" separator="," close=")"> #{deptcode} </foreach> </if> <if test="pids != null"> AND a.id NOT IN <foreach collection="pids" item="pid" open="(" separator="," close=")"> #{pid} </foreach> </if> <if test="isFilter == true"> AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </select> <!-- 门诊患者总数统计(去重) --> <select id="countPatArchiveInfoByOuthospQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> SELECT COUNT(DISTINCT a.id) FROM pat_med_outhosp d JOIN pat_archive a ON a.id = d.patid WHERE 1=1 AND d.del_flag != 1 AND a.del_flag != 1 AND d.orgid = #{orgid} <if test="pid != null and pid != ''">AND a.id = #{pid}</if> <if test="campusid != null and campusid != ''">AND a.campusid = #{campusid}</if> <if test="name != null and name != ''">AND a.name like concat('%', #{name}, '%')</if> <if test="idcardno != null and idcardno != ''">AND a.idcardno = #{idcardno}</if> <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> <if test="leavediagname != null and leavediagname != ''">AND d.diagname LIKE concat('%',#{leavediagname}, '%')</if> <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> <if test="visitno != null and visitno != ''">AND d.outhospno = #{visitno}</if> <if test="deptname != null and deptname != ''">AND d.deptname LIKE concat('%', #{deptname}, '%')</if> <if test="drname != null and drname != ''">AND d.drname LIKE concat('%',#{drname}, '%')</if> <if test="drcode != null">AND d.drcode = #{drcode}</if> <if test="pids != null"> AND a.id NOT IN <foreach collection="pids" item="pid" open="(" separator="," close=")"> #{pid} </foreach> </if> <if test="isFilter == true"> AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </select> <!-- 体检患者总数统计(去重) --> <select id="countPatArchiveInfoByPhysicalQC" parameterType="com.smartor.domain.PatArchiveReq" resultType="long"> SELECT COUNT(DISTINCT a.id) FROM pat_med_physical d JOIN pat_archive a ON a.id = d.patid WHERE 1=1 AND d.del_flag != 1 AND a.del_flag != 1 AND d.orgid = #{orgid} <if test="pid != null and pid != ''">AND a.id = #{pid}</if> <if test="campusid != null and campusid != ''">AND a.campusid = #{campusid}</if> <if test="name != null and name != ''">AND a.name like concat('%', #{name}, '%')</if> <if test="idcardno != null and idcardno != ''">AND a.idcardno = #{idcardno}</if> <if test="telcode != null and telcode != ''">AND a.telcode = #{telcode}</if> <if test="hospitaldistrictname != null and hospitaldistrictname != ''">AND d.hospitaldistrictname LIKE concat('%',#{hospitaldistrictname}, '%')</if> <if test="diagname != null and diagname != ''">AND d.diagname LIKE concat('%',#{diagname}, '%')</if> <if test="notrequiredFlag != null and notrequiredFlag != ''">AND a.notrequired_flag = #{notrequiredFlag}</if> <if test="hospitalname != null and hospitalname != ''">AND d.hospitalname = #{hospitalname}</if> <if test="visitno != null and visitno != ''">AND d.physno = #{visitno}</if> <if test="deptname != null and deptname != ''">AND d.deptname LIKE concat('%', #{deptname}, '%')</if> <if test="drname != null and drname != ''">AND d.drname LIKE concat('%',#{drname}, '%')</if> <if test="pids != null"> AND a.id NOT IN <foreach collection="pids" item="pid" open="(" separator="," close=")"> #{pid} </foreach> </if> <if test="isFilter == true"> AND NOT exists ( SELECT 1 FROM pat_filterlist f where d.patid=f.patid) </if> </select> </mapper> smartor/src/main/resources/mapper/smartor/PatArchivetagMapper.xml
@@ -142,4 +142,21 @@ #{id} </foreach> </delete> <select id="getTagsByPatIds" parameterType="Long" resultType="Map"> select patid, GROUP_CONCAT(tagname) AS tagnames where 1=1 and del_flag = 0 <if test="orgid != null and orgid != ''"> AND orgid = #{orgid} </if> <if test="patIds != null and patIds.size()>0"> AND patid IN <foreach collection="patIds" item="patId" open="(" separator="," close=")"> #{patId} </foreach> </if> group by patid </select> </mapper> smartor/src/main/resources/mapper/smartor/ServiceSubtaskMapper.xml
@@ -561,6 +561,21 @@ ) a </select> <select id="selectTimelyRateBatch" parameterType="com.smartor.domain.ServiceSubtask" resultType="map"> SELECT <if test="deptcode != null">deptcode as groupKey,</if> <if test="leavehospitaldistrictcode != null">leavehospitaldistrictcode as groupKey,</if> <if test="drcode != null">drcode as groupKey,</if> SUM(CASE WHEN DATE(visit_time) < DATE(IFNULL(finishtime, NOW())) THEN 1 ELSE 0 END) / COUNT(*) as rate FROM service_subtask WHERE del_flag = 0 AND visit_time >= #{starttime} AND visit_time < DATE_ADD(#{endtime}, INTERVAL 1 DAY) <if test="orgid != null">AND orgid = #{orgid}</if> GROUP BY groupKey </select> <select id="selectTimelyRateDetail" parameterType="com.smartor.domain.ServiceSubtask" resultMap="ServiceSubtaskResult"> <include refid="selectServiceSubtaskVo"/> @@ -1206,11 +1221,11 @@ #{serviceType} </foreach> </if> <if test="startTime != null and endTime!=null"> AND date_format(visit_time,'%y%m%d') >= date_format(#{startTime},'%y%m%d') AND date_format(visit_time,'%y%m%d') <= date_format(#{endTime},'%y%m%d') </if> <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> <if test="startTime != null and endTime!=null"> AND visit_time >= DATE(#{startTime}) AND visit_time < DATE_ADD(DATE(#{endTime}), INTERVAL 1 DAY) </if> <if test="visitDeptCode != null">and visit_dept_code = #{visitDeptCode}</if> <if test="visitDeptName != null">and visit_dept_name = #{visitDeptName}</if> <if test="isabnormal != null">and isabnormal = #{isabnormal}</if> <!-- 目前只统计语音和问卷 -->