From c871980a65d6344e170aacf949d4db2b6fd255f5 Mon Sep 17 00:00:00 2001 From: hujl Date: Fri, 24 Dec 2021 13:55:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=8D=E5=8D=B0=E8=AE=B0=E5=BD=95(=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1+=E6=98=8E=E7=BB=86)=E3=80=81=E6=89=AB=E6=8F=8F?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0(=E7=BB=9F=E8=AE=A1=E5=92=8C=E6=98=8E?= =?UTF-8?q?=E7=BB=86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../emr/controller/CopyListController.java | 107 + .../emr/controller/ScanListController.java | 99 + .../com/emr/dao/Archive_MasterMapper.java | 16 + .../com/emr/entity/Archive_Master_Vo.java | 30 + .../emr/service/Archive_MasterService.java | 31 + .../java/com/emr/service/ScanInfoService.java | 18 + .../ipml/Archive_MasterServiceImpl.java | 68 + .../emr/service/ipml/ScanInfoServiceImpl.java | 490 +++ src/main/java/com/emr/util/DatelUtils.java | 139 + src/main/java/com/emr/util/JdbcUtil.java | 122 + src/main/resources/config/config.properties | 17 +- .../resources/mapper/Archive_MasterMapper.xml | 3405 +++++++++-------- .../WEB-INF/views/copyDir/copyCountList.jsp | 384 ++ .../WEB-INF/views/copyDir/copyDetailList.jsp | 422 ++ .../MedicalRecordStorage.jsp | 2 +- .../WEB-INF/views/scanDir/scanCountList.jsp | 392 ++ .../WEB-INF/views/scanDir/scanDetailList.jsp | 423 ++ 17 files changed, 4507 insertions(+), 1658 deletions(-) create mode 100644 src/main/java/com/emr/controller/CopyListController.java create mode 100644 src/main/java/com/emr/controller/ScanListController.java create mode 100644 src/main/java/com/emr/service/ScanInfoService.java create mode 100644 src/main/java/com/emr/service/ipml/ScanInfoServiceImpl.java create mode 100644 src/main/java/com/emr/util/DatelUtils.java create mode 100644 src/main/java/com/emr/util/JdbcUtil.java create mode 100644 src/main/webapp/WEB-INF/views/copyDir/copyCountList.jsp create mode 100644 src/main/webapp/WEB-INF/views/copyDir/copyDetailList.jsp create mode 100644 src/main/webapp/WEB-INF/views/scanDir/scanCountList.jsp create mode 100644 src/main/webapp/WEB-INF/views/scanDir/scanDetailList.jsp diff --git a/src/main/java/com/emr/controller/CopyListController.java b/src/main/java/com/emr/controller/CopyListController.java new file mode 100644 index 00000000..9243afe3 --- /dev/null +++ b/src/main/java/com/emr/controller/CopyListController.java @@ -0,0 +1,107 @@ +/** + * Copyright (C), 2015-2019 + * Author: HJL + * Date: 2019/7/19 14:39 + * Description:病案召回 + */ +package com.emr.controller; + +import com.emr.entity.Archive_Master_Vo; +import com.emr.entity.OffsetLimitPage; +import com.emr.service.Archive_MasterService; +import com.emr.util.DatelUtils; +import com.emr.util.ThreadExcelUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +import static com.emr.util.DatelUtils.addDayFun; +import static com.emr.util.DatelUtils.compareDate; + + +//@PropertySource(value = "classpath:config/jdbc.properties", encoding = "UTF-8") +@Controller +@RequestMapping("/copyInfo") +public class CopyListController { + + @Autowired + private Archive_MasterService archiveMasterService; + + @RequestMapping(value = "/copyDetailList") + public String faults(Model model) { + return "copyDir/copyDetailList"; + } + + @ResponseBody + @RequestMapping(value = "/copyDetailPage") + public OffsetLimitPage copyDetailPage(HttpServletRequest request, HttpServletResponse response,Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) throws Exception { + //判断复制时段类型 + archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo); + OffsetLimitPage result = (OffsetLimitPage) archiveMasterService.copyDetailList(archiveMasterVo, offset, limit); + return result; + } + + @ResponseBody + @RequestMapping(value = "/exportExcel") + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception { + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + String[] header = {"记帐号","住院号","住院次数","患者姓名","性别","入院日期","出院日期","出院科室","主管医生","复印内容","复印日期"}; + String[] fileNames = {"patientId","inpNo","visitId","name","sex","admissionDateTime","dischargeDateTime","deptName","doctorInCharge","content","createTime"}; + //文件名 + String fileName = "复印记录明细" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //构造excel的数据beHospList + archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo); + List list = archiveMasterService.copyDetailList(archiveMasterVo); + ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); + String result=utils.exportExcelToFilePath(response,utils.listConvert(list)); + } + + /* + * 复印记录统计 + * */ + @RequestMapping(value = "/copyCountList") + public String faultsLog(Model model) { + return "copyDir/copyCountList"; + } + + /* + * 复印记录统计分页 + * */ + @ResponseBody + @RequestMapping(value = "/copyCountPage") + public OffsetLimitPage copyCountPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception { + archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo); + OffsetLimitPage result = archiveMasterService.copyCountList(archiveMasterVo, offset, limit); + return result; + } + + @ResponseBody + @RequestMapping(value = "/exportCountExcel") + public void exportCountExcel(HttpServletResponse response,Archive_Master_Vo archiveMasterVo) throws Exception { + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + String[] header = {"记帐号","住院号","住院次数","患者姓名","复印日期","复印次数"}; + String[] fileNames = {"patientId","inpNo","visitId","name","createTime","numb"}; + //文件名 + String fileName = "复印记录统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //构造excel的数据beHospList + archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo); + List list = archiveMasterService.copyCountList(archiveMasterVo); + ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); + String result=utils.exportExcelToFilePath(response,utils.listConvert(list)); + } + + + + +} + + diff --git a/src/main/java/com/emr/controller/ScanListController.java b/src/main/java/com/emr/controller/ScanListController.java new file mode 100644 index 00000000..a8a19d21 --- /dev/null +++ b/src/main/java/com/emr/controller/ScanListController.java @@ -0,0 +1,99 @@ +package com.emr.controller; + +import com.emr.entity.Archive_Master_Vo; +import com.emr.entity.OffsetLimitPage; +import com.emr.entity.Zd_Assort; +import com.emr.service.ScanInfoService; +import com.emr.util.DatelUtils; +import com.emr.util.ThreadExcelUtils; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.text.SimpleDateFormat; +import java.util.Date; +import java.util.List; + +@Controller +@RequestMapping("/scanInfo") +public class ScanListController { + @Autowired + private ScanInfoService scanInfoService; + + /* + * 扫描上传记录统计 + * */ + @RequestMapping(value = "/scanCount") + public String scanCount(Model model) { + return "scanDir/scanCountList"; + } + + /* + * 复印记录统计分页 + * */ + @ResponseBody + @RequestMapping(value = "/scanCountPage") + public OffsetLimitPage scanCountPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception { + archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo); + OffsetLimitPage result = (OffsetLimitPage) scanInfoService.scanCountPage(archiveMasterVo, offset, limit); + return result; + } + + @ResponseBody + @RequestMapping(value = "/exportCountExcel") + public void exportCountExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception { + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + String[] header = {"扫描人","扫描日期","扫描次数","扫描份数"}; + String[] fileNames = {"creater","createTime","numb","content"}; + //文件名 + String fileName = "扫描上传记录统计" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //构造excel的数据beHospList + archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo); + List list = scanInfoService.scanCountList(archiveMasterVo); + ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); + String result=utils.exportExcelToFilePath(response,utils.listConvert(list)); + } + + + /* + * 扫描上传记录明细 + * */ + @RequestMapping(value = "/scanDetailList") + public String scanDetailList(Model model) { + return "scanDir/scanDetailList"; + } + + /* + * 复印记录统计明细 + * */ + @ResponseBody + @RequestMapping(value = "/scanDetailPage") + public OffsetLimitPage scanDetailPage(HttpServletRequest request, HttpServletResponse response, Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit)throws Exception { + archiveMasterVo= DatelUtils.setMaterVoFun(archiveMasterVo); + OffsetLimitPage result = (OffsetLimitPage) scanInfoService.scanDetailPage(archiveMasterVo, offset, limit); + return result; + } + + @ResponseBody + @RequestMapping(value = "/exportExcel") + public void exportExcel(HttpServletResponse response, Archive_Master_Vo archiveMasterVo) throws Exception { + response.setContentType("application/vnd.ms-excel;charset=UTF-8"); + /* String[] header = {"记帐号","住院号","住院次数","患者姓名","性别","入院日期","出院日期","出院科室","主管医生","扫描人","文件名","扫描日期"}; + String[] fileNames = {"patientId","inpNo","visitId","name","sex","admissionDateTime","dischargeDateTime","deptName","doctorInCharge","creater","content","createTime"};*/ + String[] header = {"记帐号","住院号","住院次数","患者姓名","出院日期","扫描人","文件名","扫描日期"}; + String[] fileNames = {"patientId","inpNo","visitId","name","dischargeDateTime","creater","content","createTime"}; + //文件名 + String fileName = "扫描上传记录明细" + new SimpleDateFormat("yyyyMMddHHmmss").format(new Date()) + ".xls"; + //构造excel的数据beHospList + archiveMasterVo=DatelUtils.setMaterVoFun(archiveMasterVo); + List list = scanInfoService.scanDetailList(archiveMasterVo); + ThreadExcelUtils utils = new ThreadExcelUtils(fileName, "", header, fileNames); + String result=utils.exportExcelToFilePath(response,utils.listConvert(list)); + } +} diff --git a/src/main/java/com/emr/dao/Archive_MasterMapper.java b/src/main/java/com/emr/dao/Archive_MasterMapper.java index 28e3686f..128c4fd1 100644 --- a/src/main/java/com/emr/dao/Archive_MasterMapper.java +++ b/src/main/java/com/emr/dao/Archive_MasterMapper.java @@ -169,4 +169,20 @@ public interface Archive_MasterMapper { * @return */ List selectStorageByCol(Archive_Master_Vo record); + + + /** + * 复印记录明细 + * @param record + * @return + */ + List copyDetailList(Archive_Master_Vo record); + + + /** + * 复印记录统计 + * @param record + * @return + */ + List copyCountList(Archive_Master_Vo record); } \ No newline at end of file diff --git a/src/main/java/com/emr/entity/Archive_Master_Vo.java b/src/main/java/com/emr/entity/Archive_Master_Vo.java index ab6bcdfb..550013e9 100644 --- a/src/main/java/com/emr/entity/Archive_Master_Vo.java +++ b/src/main/java/com/emr/entity/Archive_Master_Vo.java @@ -160,6 +160,12 @@ public class Archive_Master_Vo { //2021-8-06 ,退回给护士的缺陷数量(出院浏览页面使用) private String faultNurseNum; + private String creater; + + private String updater; + + private String remark; + public String getFaultDoctorNum() { return faultDoctorNum; } @@ -710,6 +716,30 @@ public class Archive_Master_Vo { public void setEndSignDate(String endSignDate) { this.endSignDate = endSignDate; } + + public String getCreater() { + return creater; + } + + public void setCreater(String creater) { + this.creater = creater; + } + + public String getUpdater() { + return updater; + } + + public void setUpdater(String updater) { + this.updater = updater; + } + + public String getRemark() { + return remark; + } + + public void setRemark(String remark) { + this.remark = remark; + } } diff --git a/src/main/java/com/emr/service/Archive_MasterService.java b/src/main/java/com/emr/service/Archive_MasterService.java index 206468eb..d7a72846 100644 --- a/src/main/java/com/emr/service/Archive_MasterService.java +++ b/src/main/java/com/emr/service/Archive_MasterService.java @@ -264,6 +264,37 @@ public interface Archive_MasterService { List selectStorageByCol(Archive_Master_Vo record); String returnEmr(Emr_Fault_Detail emrFaultDetail, Archive_Master archiveMaster, HttpServletRequest request); + + /** + * 复印记录明细 + * @param record + * @return + */ + List copyDetailList(Archive_Master_Vo record); + + /** + * 复印记录明细分页 + * @param archiveMasterVo + * @param offset + * @param limit + * @return + */ + OffsetLimitPage copyDetailList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); + /** + * 复印记录统计 + * @param record + * @return + */ + List copyCountList(Archive_Master_Vo record); + + /** + * 复印记录统计分页 + * @param archiveMasterVo + * @param offset + * @param limit + * @return + */ + OffsetLimitPage copyCountList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); } diff --git a/src/main/java/com/emr/service/ScanInfoService.java b/src/main/java/com/emr/service/ScanInfoService.java new file mode 100644 index 00000000..c2c15500 --- /dev/null +++ b/src/main/java/com/emr/service/ScanInfoService.java @@ -0,0 +1,18 @@ +package com.emr.service; + +import com.emr.entity.Archive_Master; +import com.emr.entity.Archive_Master_Vo; +import com.emr.entity.OffsetLimitPage; +import com.emr.entity.Zd_Assort; + +import java.util.List; + +public interface ScanInfoService { + OffsetLimitPage scanCountPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); + + List scanCountList(Archive_Master_Vo archiveMasterVo); + + OffsetLimitPage scanDetailPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit); + + List scanDetailList(Archive_Master_Vo archiveMasterVo); +} diff --git a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java index 6edc37f3..611f4705 100644 --- a/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java +++ b/src/main/java/com/emr/service/ipml/Archive_MasterServiceImpl.java @@ -641,6 +641,74 @@ public class Archive_MasterServiceImpl implements Archive_MasterService { } return returnMsg; } + + @Override + public List copyDetailList(Archive_Master_Vo archiveMasterVo) { + List list = archiveMasterMapper.copyDetailList(archiveMasterVo); + //查询用户集合 + JSONArray powerUsers = powerUserService.getPowerUserList("1"); + List powerUserList = null; + if (!CollectionUtils.isEmpty(powerUsers)) { + //转换对象 + powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class); + } + //遍历赋值 + for (Archive_Master_Vo archiveMaster : list) { + if (null != powerUserList) { + //获取主管医生 + String doctorInCharge = archiveMaster.getDoctorInCharge(); + //遍历匹配工号赋值姓名 + for (Power_User_Dto powerUserDto : powerUserList) { + String name = powerUserDto.getName(); + if (StringUtils.isNotBlank(doctorInCharge) && powerUserDto.getUserName().equals(doctorInCharge)) { + archiveMaster.setDoctorInCharge(name); + } + } + } + } + return list; + } + + @Override + public OffsetLimitPage copyDetailList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + PageHelper.offsetPage(offset, limit); + List list = archiveMasterMapper.copyDetailList(archiveMasterVo); + //查询用户集合 + JSONArray powerUsers = powerUserService.getPowerUserList("1"); + List powerUserList = null; + if (!CollectionUtils.isEmpty(powerUsers)) { + //转换对象 + powerUserList = JSONArray.parseArray(powerUsers.toJSONString(), Power_User_Dto.class); + } + //遍历赋值 + for (Archive_Master_Vo archiveMaster : list) { + if (null != powerUserList) { + //获取主管医生 + String doctorInCharge = archiveMaster.getDoctorInCharge(); + //遍历匹配工号赋值姓名 + for (Power_User_Dto powerUserDto : powerUserList) { + String name = powerUserDto.getName(); + if (StringUtils.isNotBlank(doctorInCharge) && powerUserDto.getUserName().equals(doctorInCharge)) { + archiveMaster.setDoctorInCharge(name); + } + } + } + } + return new OffsetLimitPage((Page) list); + } + + @Override + public List copyCountList(Archive_Master_Vo archiveMasterVo) { + List list = archiveMasterMapper.copyCountList(archiveMasterVo); + return list; + } + + @Override + public OffsetLimitPage copyCountList(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + PageHelper.offsetPage(offset, limit); + List list = archiveMasterMapper.copyCountList(archiveMasterVo); + return new OffsetLimitPage((Page) list); + } } diff --git a/src/main/java/com/emr/service/ipml/ScanInfoServiceImpl.java b/src/main/java/com/emr/service/ipml/ScanInfoServiceImpl.java new file mode 100644 index 00000000..c288a767 --- /dev/null +++ b/src/main/java/com/emr/service/ipml/ScanInfoServiceImpl.java @@ -0,0 +1,490 @@ +package com.emr.service.ipml; + +import com.emr.entity.Archive_Master_Vo; +import com.emr.entity.OffsetLimitPage; +import com.emr.entity.Zd_Assort; +import com.emr.service.ScanInfoService; +import com.emr.util.JdbcUtil; +import com.github.pagehelper.Page; +import com.github.pagehelper.PageHelper; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.util.ArrayList; +import java.util.List; + +@Service +@Transactional +public class ScanInfoServiceImpl implements ScanInfoService { + + @Override + public OffsetLimitPage scanCountPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + PageHelper.offsetPage(offset, limit); + //开始和结束行数 + Integer stratRow=(offset/10)*limit; + Integer endRow=(offset/10)*limit+limit; + Connection con = null; + PreparedStatement stmt = null; + ResultSet rs = null; + int rowTotal=0; + List list=new ArrayList<>(); + int a=0,b=0,c=0,d=0; + try { + con = JdbcUtil.getConnection(); + String sql = "";//"select * from [zd_Assort] where print_flag=?"; + /*select c.patient_id,c.numb,a.assort_name,a.assort_date,content from( + select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id + )c + LEFT JOIN( + select patient_id,assort_name,convert(varchar(10), assort_date,23) assort_date from t_gdh_index where patient_id is not null and patient_id!='' + )a + on c.patient_id=a.patient_id + LEFT JOIN( + select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id + )b + on a.patient_id=b.patient_id*/ + //查询总记录数 + sql = "select count(*) from( " + + " select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " + + " select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " + + " )c " + + " LEFT JOIN( " + + " select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " + + " )a " + + " on c.patient_id=a.patient_id " + + " LEFT JOIN( " + + " select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " + + " )b " + + " on a.patient_id=b.patient_id " + + " )m group by creater,create_time having 1=1 "; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + } + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + rs.next(); + rowTotal=rs.getInt(1); + sql="select * from(" + + "select ROW_NUMBER() over(order by creater desc) RowNum,creater,create_time,sum(numb) numb ,sum(content) content from( " + + " select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " + + " select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " + + " )c " + + " LEFT JOIN( " + + " select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " + + " )a " + + " on c.patient_id=a.patient_id " + + " LEFT JOIN( " + + " select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " + + " )b " + + " on a.patient_id=b.patient_id " + + " )m group by creater,create_time having 1=1 "; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + } + sql+= " ) as t1 " + + " where 1=1 and RowNum>"+stratRow+" and RowNum<="+endRow ; + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + + Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo(); + while(rs.next()) + { + archiveMasterVo1=new Archive_Master_Vo(); + String creater = rs.getString("creater");//扫描人 + String createTime = rs.getString("create_time");//扫描时间 + int numb=Integer.parseInt(rs.getString("numb"));//扫描次数 + String content=rs.getString("content");//扫描份数 + archiveMasterVo1.setCreater(creater); + archiveMasterVo1.setCreateTime(createTime); + archiveMasterVo1.setNumb(numb); + archiveMasterVo1.setContent(content); + list.add(archiveMasterVo1); + } + } catch (Exception w) { + w.printStackTrace(); + }finally{ + JdbcUtil.close(rs, stmt, con); + } + OffsetLimitPage offsetLimitPage=new OffsetLimitPage(); + offsetLimitPage.setTotal((long) rowTotal); + offsetLimitPage.setRows(list); + return offsetLimitPage; + } + + @Override + public List scanCountList(Archive_Master_Vo archiveMasterVo) { + Connection con = null; + PreparedStatement stmt = null; + ResultSet rs = null; + List list=new ArrayList<>(); + int a=0,b=0,c=0,d=0; + try { + con = JdbcUtil.getConnection(); + String sql = ""; + sql = "select creater,create_time,sum(numb) numb ,sum(content) content from( " + + " select c.patient_id,c.numb,a.assort_name creater,a.create_time,content from( " + + " select patient_id,assort_id,COUNT(*) numb from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id,assort_id " + + " )c " + + " LEFT JOIN( " + + " select patient_id,assort_name,convert(varchar(10), assort_date,23) create_time from t_gdh_index where patient_id is not null and patient_id!='' " + + " )a " + + " on c.patient_id=a.patient_id " + + " LEFT JOIN( " + + " select patient_id,COUNT(*) content from t_scan_assort where patient_id is not null and patient_id!='' group by patient_id " + + " )b " + + " on a.patient_id=b.patient_id " + + " )m group by creater,create_time having 1=1 "; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), create_time, 23)>=?" ; + } + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo(); + while(rs.next()) + { + archiveMasterVo1=new Archive_Master_Vo(); + String creater = rs.getString("creater");//扫描人 + String createTime = rs.getString("create_time");//扫描时间 + int numb=Integer.parseInt(rs.getString("numb"));//扫描次数 + String content=rs.getString("content");//扫描份数 + archiveMasterVo1.setCreater(creater); + archiveMasterVo1.setCreateTime(createTime); + archiveMasterVo1.setNumb(numb); + archiveMasterVo1.setContent(content); + list.add(archiveMasterVo1); + } + } catch (Exception e) { + e.printStackTrace(); + }finally{ + JdbcUtil.close(rs, stmt, con); + } + return list; + } + + @Override + public OffsetLimitPage scanDetailPage(Archive_Master_Vo archiveMasterVo, Integer offset, Integer limit) { + PageHelper.offsetPage(offset, limit); + //开始和结束行数 + Integer stratRow=(offset/10)*limit; + Integer endRow=(offset/10)*limit+limit; + Connection con = null; + PreparedStatement stmt = null; + ResultSet rs = null; + int rowTotal=0; + int a=0,b=0,c=0,d=0; + List list=new ArrayList<>();; + try { + con = JdbcUtil.getConnection(); + String sql = "";//"select * from [zd_Assort] where print_flag=?"; + //查询总记录数 + sql = "select count(*) from(" + + " select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" + + " )a" + + " left join (" + + " select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " + + " from t_gdh_index where patient_id is not null and patient_id!=''" + + " )b" + + " on a.patient_id2=b.patient_id" + + " where 1=1"; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + } + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + rs.next(); + rowTotal=rs.getInt(1); + + sql="select * from (" + + "select ROW_NUMBER() over(order by assort_id desc) RowNum ,b.*,a.scan_page content from(" + + " select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" + + " )a" + + " left join (" + + " select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " + + " from t_gdh_index where patient_id is not null and patient_id!=''" + + " )b" + + " on a.patient_id2=b.patient_id" + + " where 1=1 "; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + } + sql+=" ) as t1 " + + " where 1=1 and RowNum>"+stratRow+" and RowNum<="+endRow ; + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + + Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo(); + while(rs.next()) + { + archiveMasterVo1=new Archive_Master_Vo(); + String patientId = rs.getString("patient_id"); + String inpNo = rs.getString("inp_no"); + String visitId = rs.getString("visit_id"); + String name = rs.getString("name"); + // String sex = rs.getString("sex"); + //String admissionDateTime = rs.getString("admission_date_time"); + String dischargeDateTime = rs.getString("discharge_date_time"); + // String deptName = rs.getString("dept_name"); + // String doctorInCharge = rs.getString("doctor_in_charge"); + String creater = rs.getString("creater");//扫描人 + String content = rs.getString("content");//文件名 + String createTime = rs.getString("create_time");//扫描时间 + + archiveMasterVo1.setPatientId(patientId); + archiveMasterVo1.setInpNo(inpNo); + archiveMasterVo1.setVisitId(visitId); + archiveMasterVo1.setName(name); + //archiveMasterVo1.setSex(sex); + //archiveMasterVo1.setAdmissionDateTime(admissionDateTime); + archiveMasterVo1.setDischargeDateTime(dischargeDateTime); + // archiveMasterVo1.setDeptName(deptName); + // archiveMasterVo1.setDoctorInCharge(doctorInCharge); + archiveMasterVo1.setCreater(creater); + archiveMasterVo1.setContent(content); + archiveMasterVo1.setCreateTime(createTime); + list.add(archiveMasterVo1); + } + } catch (Exception e) { + e.printStackTrace(); + }finally{ + JdbcUtil.close(rs, stmt, con); + } + OffsetLimitPage offsetLimitPage=new OffsetLimitPage(); + offsetLimitPage.setTotal((long) rowTotal); + offsetLimitPage.setRows(list); + return offsetLimitPage; + } + + @Override + public List scanDetailList(Archive_Master_Vo archiveMasterVo) { + Connection con = null; + PreparedStatement stmt = null; + ResultSet rs = null; + List list=new ArrayList<>();; + try { + con = JdbcUtil.getConnection(); + int a=0,b=0,c=0,d=0; + String sql = "select b.*,a.scan_page content from(" + + " select patient_id patient_id2,assort_id,scan_page from t_scan_assort where patient_id is not null and patient_id!=''" + + " )a" + + " left join (" + + " select patient_id,inpatient_no inp_no,admiss_times visit_id,name,convert(varchar(19), dis_date,120) discharge_date_time,assort_name creater,convert(varchar(10), assort_date,23) create_time " + + " from t_gdh_index where patient_id is not null and patient_id!=''" + + " )b" + + " on a.patient_id2=b.patient_id" + + " where 1=1"; + if(StringUtils.isNotBlank(archiveMasterVo.getInpNo())){ + sql+=" and inp_no like '%'+?+'%'" ; + a=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getCreater())){ + sql+=" and creater like '%'+?+'%'" ; + b=1; + } + if(StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23) between ? and ? " ; + c=1;d=1; + }else if(StringUtils.isNotBlank(archiveMasterVo.getStartDate())){ + c=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + }else if(StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + d=1; + sql+=" and CONVERT (VARCHAR(10), b.create_time, 23)>=?" ; + } + stmt = con.prepareStatement(sql); + if(a==1){ + stmt.setString(a, archiveMasterVo.getInpNo()); + } + if(b==1) { + stmt.setString(a+b, archiveMasterVo.getCreater()); + } + if(c==1) { + stmt.setString(a+b+c, archiveMasterVo.getStartDate()); + } + if(d==1) { + stmt.setString(a+b+c+d, archiveMasterVo.getEndDate()); + } + rs = stmt.executeQuery(); + Archive_Master_Vo archiveMasterVo1=new Archive_Master_Vo(); + while(rs.next()) + { + archiveMasterVo1=new Archive_Master_Vo(); + String patientId = rs.getString("patient_id"); + String inpNo = rs.getString("inp_no"); + String visitId = rs.getString("visit_id"); + String name = rs.getString("name"); + // String sex = rs.getString("sex"); + // String admissionDateTime = rs.getString("admission_date_time"); + String dischargeDateTime = rs.getString("discharge_date_time"); + // String deptName = rs.getString("dept_name"); + // String doctorInCharge = rs.getString("doctor_in_charge"); + String creater = rs.getString("creater");//扫描人 + String content = rs.getString("content");//文件名 + String createTime = rs.getString("create_time");//扫描时间 + + archiveMasterVo1.setPatientId(patientId); + archiveMasterVo1.setInpNo(inpNo); + archiveMasterVo1.setVisitId(visitId); + archiveMasterVo1.setName(name); + //archiveMasterVo1.setSex(sex); + //archiveMasterVo1.setAdmissionDateTime(admissionDateTime); + archiveMasterVo1.setDischargeDateTime(dischargeDateTime); + //archiveMasterVo1.setDeptName(deptName); + // archiveMasterVo1.setDoctorInCharge(doctorInCharge); + archiveMasterVo1.setCreater(creater); + archiveMasterVo1.setContent(content); + archiveMasterVo1.setCreateTime(createTime); + list.add(archiveMasterVo1); + } + } catch (Exception e) { + e.printStackTrace(); + } finally { + JdbcUtil.close(rs, stmt, con); + } + return list; + } + + +} diff --git a/src/main/java/com/emr/util/DatelUtils.java b/src/main/java/com/emr/util/DatelUtils.java new file mode 100644 index 00000000..2e682d65 --- /dev/null +++ b/src/main/java/com/emr/util/DatelUtils.java @@ -0,0 +1,139 @@ +package com.emr.util; + +import com.emr.entity.Archive_Master_Vo; +import org.apache.commons.lang.StringUtils; + +import java.text.ParseException; +import java.text.SimpleDateFormat; +import java.util.Calendar; +import java.util.Date; + +/** + * 多线程多sheet导出数据 + */ +public class DatelUtils { + /** + * 比较两个日期的大小 + * @param time1 + * @param time2 + * @return + * @throws ParseException + */ + public static boolean compareDate(String time1,String time2) throws ParseException{ + SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd"); + Date a=sdf.parse(time1); + Date b=sdf.parse(time2); + //a早于b返回true + if(a.before(b)){ + return true; + }else{ + return false; + } + } + + + /** + * 日期增加年月日 + * @param dayStr 日期str + * @return 加上几天后的日期 + */ + public static String addDayFun(String dayStr, String dayType, int i) { + try { + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Date dt=null; + if(StringUtils.isBlank(dayStr)){ + //系统时间 + dt=sdf.parse(sdf.format(new Date())); + }else{ + dt=sdf.parse(dayStr); + } + Calendar rightNow=Calendar.getInstance(); + rightNow.setTime(dt); + if(dayType=="year") { + rightNow.add(Calendar.YEAR, i);//-1 日期减1年 + }else if(dayType=="month") { + rightNow.add(Calendar.MONTH, i);//3 日期加三个月 + }else if(dayType=="day") { + rightNow.add(Calendar.DAY_OF_YEAR, i);//15 日期加15天 + } + Date dt1=rightNow.getTime(); + String reStr=sdf.format(dt1); + //System.out.println(reStr); + return reStr; + } catch (ParseException e) { + e.printStackTrace(); + } + return null; + } + + + public static Archive_Master_Vo setMaterVoFun(Archive_Master_Vo archiveMasterVo) throws Exception { + //判断复制时段类型 + String endDateStr=""; + if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getLockinfo())){ + //day_7 month_day_15 month_1 month_3 + if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getEndDate())){ + //复印时间的截至日期,不得超过 + endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getStartDate(),"A",0); + archiveMasterVo.setEndDate(endDateStr); + }else if(org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getStartDate(),"A",0); + if(!compareDate(archiveMasterVo.getStartDate(),endDateStr)){ + archiveMasterVo.setEndDate(endDateStr); + } + }else if(org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isNotBlank(archiveMasterVo.getEndDate())){ + //反向扣除s + endDateStr=getDateFun(archiveMasterVo.getLockinfo(),archiveMasterVo.getEndDate(),"B",0); + archiveMasterVo.setStartDate(endDateStr); + }else if(org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getStartDate()) && org.apache.commons.lang3.StringUtils.isBlank(archiveMasterVo.getEndDate())){ + //系统时间 + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + String nowDate= String.valueOf(sdf.format(new Date())); + endDateStr=getDateFun(archiveMasterVo.getLockinfo(),nowDate,"B",0); + archiveMasterVo.setStartDate(endDateStr); + archiveMasterVo.setEndDate(nowDate); + } + } + archiveMasterVo.setLockinfo(null); + return archiveMasterVo; + } + public static String getDateFun(String dayType,String currDate,String dayFlag,int numb){ + String endDateStr=""; + if(dayFlag.equals("A")) { //加 + if (dayType.equals("day_7")) { + endDateStr = addDayFun(currDate, "day", 7); + } else if (dayType.equals("month_day_15")) { + endDateStr = addDayFun(currDate, "day", 15); + } else if (dayType.equals("month_1")) { + endDateStr = addDayFun(currDate, "month", 1); + } else if (dayType.equals("month_3")) { + endDateStr = addDayFun(currDate, "month", 3); + } else if (dayType.equals("day")) { + endDateStr = addDayFun(currDate, "day", numb); + } else if (dayType.equals("month")) { + endDateStr = addDayFun(currDate, "month", numb); + } + }else if(dayFlag.equals("B")) { //减 + if (dayType.equals("day_7")) { + endDateStr = addDayFun(currDate, "day", -7); + } else if (dayType.equals("month_day_15")) { + endDateStr = addDayFun(currDate, "day", -15); + } else if (dayType.equals("month_1")) { + endDateStr = addDayFun(currDate, "month", -1); + } else if (dayType.equals("month_3")) { + endDateStr = addDayFun(currDate, "month", -3); + }else if (dayType.equals("day")) { + endDateStr = addDayFun(currDate, "day", -1*numb); + } else if (dayType.equals("month")) { + endDateStr = addDayFun(currDate, "month", -1*numb); + } + } + return endDateStr; + } + + + public static void main(String[] args) throws Exception { + + System.out.println(addDayFun( "2021-12-21", "day", -15)); + } +} \ No newline at end of file diff --git a/src/main/java/com/emr/util/JdbcUtil.java b/src/main/java/com/emr/util/JdbcUtil.java new file mode 100644 index 00000000..baed303e --- /dev/null +++ b/src/main/java/com/emr/util/JdbcUtil.java @@ -0,0 +1,122 @@ +package com.emr.util; + + +import com.emr.entity.Zd_Assort; + +import java.io.InputStream; +import java.sql.Connection; +import java.sql.DriverManager; +import java.sql.ResultSet; +import java.sql.SQLException; +import java.sql.Statement; +import java.util.ArrayList; +import java.util.List; +import java.util.Properties; + +public class JdbcUtil { + private static String className; + private static String url; + private static String user; + private static String password; + + static + { + try { + InputStream in = JdbcUtil.class.getClassLoader().getResourceAsStream("config/config.properties"); + Properties props = new Properties(); + props.load(in); + className = props.getProperty("sqlServerClassName"); + url = props.getProperty("sqlServerUrl"); + user = props.getProperty("sqlServerUserName"); + password = props.getProperty("sqlServerPassword"); + + //System.out.println(className); + //System.out.println(url); + + //注册驱动 + Class.forName(className); + + } catch (Exception e) { + + e.printStackTrace(); + } + + } + + public static Connection getConnection() throws Exception + { + return DriverManager.getConnection(url, user, password); + + } + + public static void close(ResultSet rs, Statement stmt,Connection con) + { + + if(rs!=null) + { + try { + rs.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + rs= null; + } + + if(stmt!=null) + { + try { + stmt.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + stmt= null; + } + + if(con!=null) + { + try { + con.close(); + } catch (SQLException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + con= null; + } + } + + //查询 + public List select(Statement stmt) throws SQLException { + List list=new ArrayList<>(); + ResultSet rs = stmt.executeQuery("select * from [zd_assort] "); + Zd_Assort zd_assort=null; + while(rs.next()){ + zd_assort=new Zd_Assort(); + //如果对象中有数据,就会循环打印出来 + //System.out.println("类型ID="+rs.getString("assort_id")); + zd_assort.setAssortId(rs.getString("assort_id")); + zd_assort.setAssortName(rs.getString("assort_name")); + list.add(zd_assort); + //System.out.println(rs.getInt("教师编号")+","+rs.getString("姓名")+","+rs.getInt("专业")); + } + return list; + } + + //测试用例 + public static void main(String[] args) throws Exception{ + JdbcUtil d = new JdbcUtil(); + //3.通过数据库的连接操作数据库,实现增删改查 + Connection conn=d.getConnection(); + Statement stmt = conn.createStatement(); + //ResultSet executeQuery(String sqlString):执行查询数据库的SQL语句 ,返回一个结果集(ResultSet)对象。 + //d.insert(stmt); + //d.update(stmt); + List list=d.select(stmt); + System.out.println(list.get(0).getAssortName()+"=================="); + + } +} diff --git a/src/main/resources/config/config.properties b/src/main/resources/config/config.properties index 820c0ec8..652e92de 100644 --- a/src/main/resources/config/config.properties +++ b/src/main/resources/config/config.properties @@ -1,6 +1,15 @@ -#留观推送第三方接口地址 +#\u7559\u89C2\u63A8\u9001\u7B2C\u4E09\u65B9\u63A5\u53E3\u5730\u5740 observationRecordRequestUrl = http://10.162.0.51:8091/sanshuyun-ems-function/file/away/updateStatus -#模块打回第三方接口地址 +#\u6A21\u5757\u6253\u56DE\u7B2C\u4E09\u65B9\u63A5\u53E3\u5730\u5740 returnUrl = http://10.6.1.152:8085/SignWebService.asmx/PartrePair -#模块打回第三方接口参数 -returnParam = strJson \ No newline at end of file +#\u6A21\u5757\u6253\u56DE\u7B2C\u4E09\u65B9\u63A5\u53E3\u53C2\u6570 +returnParam = strJson + +#\u6A21\u5757\u626B\u63CF\u4E0A\u4F20\u62A5\u8868 +sqlServerClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver +sqlServerUrl=jdbc:sqlserver://10.3.6.94:1433;DatabaseName=headpage_gyfs_1 +sqlServerUserName=sa +sqlServerPassword=xjgs+docus911 + + + diff --git a/src/main/resources/mapper/Archive_MasterMapper.xml b/src/main/resources/mapper/Archive_MasterMapper.xml index 517279bd..532f2ce5 100644 --- a/src/main/resources/mapper/Archive_MasterMapper.xml +++ b/src/main/resources/mapper/Archive_MasterMapper.xml @@ -1,1030 +1,1030 @@ - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - + + + + + + - - - - - - + + + + + + - - - - - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState, admission_date_time, dept_admission_to, check_doctor, check_datetime, checked_doctor, transfer_dept, checked_datetime, LockInfo, DOCTOR_IN_CHARGE, ID_NO, DISCHARGE_DISPOSITION, dept_code_lend,isscaned,is_scanning, cmt_doctor,cmt_nurse,doctor_name,nurse_name,cmt_doctor_date,cmt_nurse_date,emr_doctor_cmt,emr_nure_cmt,death_flag, bed_number,is_sign,signer,sign_time - - - - - - + select + + from archive_master + where id = #{id,jdbcType=NVARCHAR} + + + + + + - + + and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} + + + and checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} + + + and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} + + + and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} + + + and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} + + + and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} + + + and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} + + + and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} + + + and m.isscaned = #{isscaned,jdbcType=NVARCHAR} + + + and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} + + ORDER BY admission_date_time desc + + - + select DISTINCT m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,ISNULL(f.name,m.dept_name) dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time, + ISNULL(d.name,m.dept_admission_to) dept_admission_to,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned, + m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.first_instance, + m.is_scanning,m.bed_number,amf.following_type,ISNULL(s.numb, 0) numb,ao.C5 is_sign + ,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(printTable.num, 0) printNum + from archive_master m + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) d + on m.dept_admission_to=d.code + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) f + on m.dept_name=f.code + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor + on m.id=sDoctor.archive_detail_id + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('2','6') GROUP BY archive_detail_id) sNurse + on m.id=sNurse.archive_detail_id + left join Archive_Master_Following amf + on m.id=amf.master_id and amf.following_type=9 + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag is not null GROUP BY archive_detail_id) s + on m.id=s.archive_detail_id + LEFT JOIN archive_other ao + on m.id=ao.masterID + and ao.sysFlag='1' + LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable + on m.id=printTable.MasterID + where 1=1 and ArchiveState in('初审') + and patindex('%B%',m.inp_no) = 0 and inp_no not like 'LG%' + + and m.id + + + in + + not in + + ( + + #{item} + + ) + + + and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%' + + + and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%' + + + and m.visit_id=#{visitId,jdbcType=NCHAR} + + + and m.name like '%'+#{name,jdbcType=NCHAR}+'%' + + + and m.ArchiveState in(#{archivestate,jdbcType=NVARCHAR}) + + + and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%' + + + and m.sex = #{sex,jdbcType=NVARCHAR} + + + and m.dept_name in + + #{item} + + + + and m.dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR} + + + and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR} + + + + and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and + #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) + + + and m.discharge_date_time <= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + + + and m.admission_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and + #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.admission_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) + + + and m.admission_date_time <= #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + - - and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} - - - and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} - - - and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} - - - and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} - - - and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} - - - and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} - - - and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} - - - and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} - - - and m.isscaned = #{isscaned,jdbcType=NVARCHAR} - - - and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} - - - and ao.C5 = #{isSign,jdbcType=NVARCHAR} - - - and ao.C1 like '%'+#{signer,jdbcType=NCHAR}+'%' - - - - and m.sign_time between CONVERT(VARCHAR(10),#{startSignDate,jdbcType=NCHAR},120) and - #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59' - - - and m.sign_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) - - - and m.sign_time <= #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59' - - + + and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} + + + and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} + + + and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} + + + and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} + + + and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} + + + and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} + + + and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} + + + and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} + + + and m.isscaned = #{isscaned,jdbcType=NVARCHAR} + + + and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} + + + and ao.C5 = #{isSign,jdbcType=NVARCHAR} + + + and ao.C1 like '%'+#{signer,jdbcType=NCHAR}+'%' + + + + and m.sign_time between CONVERT(VARCHAR(10),#{startSignDate,jdbcType=NCHAR},120) and + #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.sign_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) + + + and m.sign_time <= #{endSignDate,jdbcType=NCHAR}+ ' 23:59:59' + + - ORDER BY discharge_date_time desc - + ORDER BY discharge_date_time desc + - + select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,ISNULL(f.name,m.dept_name) dept_name,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time + ,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,ISNULL(d.name,m.dept_admission_to) dept_admission_to + ,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned, + m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.is_scanning, + m.bed_number,ISNULL(s.numb, 0) numb + from archive_master m + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) d + on m.dept_admission_to=d.code + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) f + on m.dept_name=f.code + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag is not null GROUP BY archive_detail_id) s + on m.id=s.archive_detail_id + where 1=1 + and m.ArchiveState not in('作废','已封存') and inp_no not like 'LG%' + + and m.id = #{id,jdbcType=NVARCHAR} + + + and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%' + + + and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%' + + + and m.visit_id=#{visitId,jdbcType=NCHAR} + + + and m.name like '%'+#{name,jdbcType=NCHAR}+'%' + + + and m.ArchiveState in + + #{item} + + + + and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%' + + + and m.sex = #{sex,jdbcType=NVARCHAR} + + + and m.dept_name in + + #{item} + + + + and m.dept_admission_to in + + #{item} + + + + + + + and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR} + + + + and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and + #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) + + + and m.discharge_date_time <= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + + + and m.admission_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and + #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.admission_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) + + + and m.admission_date_time <= #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + - - and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} - - - and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} - - - and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} - - - and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} - - - and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} - - - and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} - - - and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} - - - and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} - - - and m.isscaned = #{isscaned,jdbcType=NVARCHAR} - - - and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} - - - and m.death_flag = #{deathFlag,jdbcType=NVARCHAR} - - ORDER BY discharge_date_time desc - + + and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} + + + and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} + + + and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} + + + and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} + + + and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} + + + and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} + + + and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} + + + and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} + + + and m.isscaned = #{isscaned,jdbcType=NVARCHAR} + + + and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} + + + and m.death_flag = #{deathFlag,jdbcType=NVARCHAR} + + ORDER BY discharge_date_time desc + - + select m.id,m.patient_id,m.inp_no,m.visit_id,m.name,m.sex,ISNULL(f.name,m.dept_name) dept_name + ,CONVERT(varchar(10),m.discharge_date_time, 120) discharge_date_time,m.ArchiveState,CONVERT(varchar(10),m.admission_date_time, 120) admission_date_time,ISNULL(d.name,m.dept_admission_to) dept_admission_to + ,m.check_doctor,m.checked_datetime,m.checked_doctor,m.LockInfo,m.DOCTOR_IN_CHARGE,m.ID_NO,m.DISCHARGE_DISPOSITION,m.dept_code_lend,m.isscaned, + m.cmt_doctor,m.cmt_nurse,m.doctor_name,m.nurse_name,m.cmt_doctor_date,m.cmt_nurse_date,m.emr_doctor_cmt,m.emr_nure_cmt,m.death_flag,m.is_scanning, + m.bed_number,ISNULL(s.numb, 0) numb,ISNULL(amf.num, 0) checkFlag + ,ISNULL(sDoctor.numb, 0) faultDoctorNum,ISNULL(sNurse.numb, 0) faultNurseNum,ISNULL(printTable.num, 0) printNum + from archive_master m + LEFT JOIN(select master_id,count(*) num from Archive_Master_Following where following_type=5 GROUP BY master_id ) amf + on m.id=amf.master_id + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('1','5') GROUP BY archive_detail_id) sDoctor + on m.id=sDoctor.archive_detail_id + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag in ('2','6') GROUP BY archive_detail_id) sNurse + on m.id=sNurse.archive_detail_id + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) d + on m.dept_admission_to=d.code + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) f + on m.dept_name=f.code + LEFT JOIN(select archive_detail_id,count(*) numb from emr_fault_detail where 1=1 and back_flag is not null GROUP BY archive_detail_id) s + on m.id=s.archive_detail_id + LEFT JOIN (select MasterID,COUNT(*) num from archive_printInfo group by MasterID) printTable + on m.id=printTable.MasterID + where 1=1 + and patindex('%B%',m.inp_no) in (0,1) + and m.ArchiveState not in('作废','已封存') and inp_no not like 'LG%' + + and m.id + + + in + + not in + + ( + + #{item} + + ) + + + and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%' + + + and m.bed_number like '%'+#{bedNumber,jdbcType=NVARCHAR}+'%' + + + and m.visit_id=#{visitId,jdbcType=NCHAR} + + + and m.name like '%'+#{name,jdbcType=NCHAR}+'%' + + + and m.ArchiveState in + + #{item} + + + + and m.ID_NO like '%'+#{idNo,jdbcType=NCHAR}+'%' + + + and m.sex = #{sex,jdbcType=NVARCHAR} + + + and m.dept_name in + + #{item} + + + + and m.dept_admission_to in + + #{item} + + + + + + + and m.discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR} + + + + and m.discharge_date_time between CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) and + #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.discharge_date_time >= CONVERT(VARCHAR(10),#{startDateTo,jdbcType=NCHAR},120) + + + and m.discharge_date_time <= #{endDateTo,jdbcType=NCHAR}+ ' 23:59:59' + + + + + and m.admission_date_time between CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) and + #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + + and m.admission_date_time >= CONVERT(VARCHAR(10),#{startDate,jdbcType=NCHAR},120) + + + and m.admission_date_time <= #{endDate,jdbcType=NCHAR}+ ' 23:59:59' + + - - and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} - - - and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} - - - and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} - - - and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} - - - and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} - - - and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} - - - and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} - - - and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} - - - and m.isscaned = #{isscaned,jdbcType=NVARCHAR} - - - and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} - - - and m.death_flag = #{deathFlag,jdbcType=NVARCHAR} - - ORDER BY discharge_date_time desc - + + and m.check_doctor = #{checkDoctor,jdbcType=NVARCHAR} + + + and m.checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR} + + + and m.check_datetime = #{checkDatetime,jdbcType=NVARCHAR} + + + and m.checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR} + + + and m.LockInfo = #{lockinfo,jdbcType=NVARCHAR} + + + and m.DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR} + + + and m.DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR} + + + and m.dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR} + + + and m.isscaned = #{isscaned,jdbcType=NVARCHAR} + + + and m.is_scanning = #{isScanning,jdbcType=NVARCHAR} + + + and m.death_flag = #{deathFlag,jdbcType=NVARCHAR} + + ORDER BY discharge_date_time desc + - - - - - - + + + + + + delete from archive_master where id = #{id,jdbcType=NVARCHAR} - + insert into archive_master (id, patient_id, inp_no, visit_id, name, sex, dept_name, discharge_date_time, ArchiveState, @@ -1040,254 +1040,254 @@ #{lockinfo,jdbcType=NVARCHAR}, #{doctorInCharge,jdbcType=NVARCHAR}, #{idNo,jdbcType=NVARCHAR}, #{dischargeDisposition,jdbcType=NVARCHAR}, #{deptCodeLend,jdbcType=NVARCHAR}, #{isscaned,jdbcType=NVARCHAR}, #{firstInstance,jdbcType=NVARCHAR}) - - insert into archive_master - - - id, - - - patient_id, - - - inp_no, - - - visit_id, - - - name, - - - sex, - - - dept_name, - - - discharge_date_time, - - - ArchiveState, - - - admission_date_time, - - - dept_admission_to, - - - check_doctor, - - - check_datetime, - - - checked_doctor, - - - checked_datetime, - - - LockInfo, - - - DOCTOR_IN_CHARGE, - - - ID_NO, - - - DISCHARGE_DISPOSITION, - - - dept_code_lend, - - - isscaned, - - - first_instance, - - - - - #{id,jdbcType=NVARCHAR}, - - - #{patientId,jdbcType=NVARCHAR}, - - - #{inpNo,jdbcType=NVARCHAR}, - - - #{visitId,jdbcType=NVARCHAR}, - - - #{name,jdbcType=NVARCHAR}, - - - #{sex,jdbcType=NVARCHAR}, - - - #{deptName,jdbcType=NVARCHAR}, - - - #{dischargeDateTime,jdbcType=NVARCHAR}, - - - #{archivestate,jdbcType=NVARCHAR}, - - - #{admissionDateTime,jdbcType=NVARCHAR}, - - - #{deptAdmissionTo,jdbcType=NVARCHAR}, - - - #{checkDoctor,jdbcType=NVARCHAR}, - - - #{checkDatetime,jdbcType=NVARCHAR}, - - - #{checkedDoctor,jdbcType=NVARCHAR}, - - - #{checkedDatetime,jdbcType=NVARCHAR}, - - - #{lockinfo,jdbcType=NVARCHAR}, - - - #{doctorInCharge,jdbcType=NVARCHAR}, - - - #{idNo,jdbcType=NVARCHAR}, - - - #{dischargeDisposition,jdbcType=NVARCHAR}, - - - #{deptCodeLend,jdbcType=NVARCHAR}, - - - #{isscaned,jdbcType=NVARCHAR}, - - - #{firstInstance,jdbcType=NVARCHAR}, - - - - - update archive_master - - - patient_id = #{patientId,jdbcType=NVARCHAR}, - - - inp_no = #{inpNo,jdbcType=NVARCHAR}, - - - visit_id = #{visitId,jdbcType=NVARCHAR}, - - - name = #{name,jdbcType=NVARCHAR}, - - - sex = #{sex,jdbcType=NVARCHAR}, - - - dept_name = #{deptName,jdbcType=NVARCHAR}, - - - discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}, - - - ArchiveState = #{archivestate,jdbcType=NVARCHAR}, - - - admission_date_time = #{admissionDateTime,jdbcType=NVARCHAR}, - - - dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}, - - - check_doctor = #{checkDoctor,jdbcType=NVARCHAR}, - - - check_datetime = #{checkDatetime,jdbcType=NVARCHAR}, - - - checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}, - - - checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}, - - - LockInfo = #{lockinfo,jdbcType=NVARCHAR}, - - - DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}, - - - ID_NO = #{idNo,jdbcType=NVARCHAR}, - - - DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}, - - - dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}, - - - isscaned = #{isscaned,jdbcType=NVARCHAR}, - - - is_scanning = #{isScanning,jdbcType=NVARCHAR}, - - - cmt_doctor = #{cmtDoctor,jdbcType=INTEGER}, - - - cmt_nurse = #{cmtNurse,jdbcType=INTEGER}, - - - doctor_name = #{doctorName,jdbcType=NVARCHAR}, - - - nurse_name = #{nurseName,jdbcType=NVARCHAR}, - - - cmt_doctor_date = #{cmtDoctorDate,jdbcType=NVARCHAR}, - - - cmt_doctor_date=null, - - - cmt_nurse_date = #{cmtNurseDate,jdbcType=NVARCHAR}, - - - cmt_nurse_date=null, - - - first_instance=#{firstInstance,jdbcType=NVARCHAR}, - - - score=#{score,jdbcType=NVARCHAR}, - - - is_sign=#{isSign,jdbcType=INTEGER}, - - - signer=#{signer,jdbcType=NVARCHAR}, - - - sign_time=#{signTime,jdbcType=NVARCHAR} - - - where id = #{id,jdbcType=NVARCHAR} - - + + insert into archive_master + + + id, + + + patient_id, + + + inp_no, + + + visit_id, + + + name, + + + sex, + + + dept_name, + + + discharge_date_time, + + + ArchiveState, + + + admission_date_time, + + + dept_admission_to, + + + check_doctor, + + + check_datetime, + + + checked_doctor, + + + checked_datetime, + + + LockInfo, + + + DOCTOR_IN_CHARGE, + + + ID_NO, + + + DISCHARGE_DISPOSITION, + + + dept_code_lend, + + + isscaned, + + + first_instance, + + + + + #{id,jdbcType=NVARCHAR}, + + + #{patientId,jdbcType=NVARCHAR}, + + + #{inpNo,jdbcType=NVARCHAR}, + + + #{visitId,jdbcType=NVARCHAR}, + + + #{name,jdbcType=NVARCHAR}, + + + #{sex,jdbcType=NVARCHAR}, + + + #{deptName,jdbcType=NVARCHAR}, + + + #{dischargeDateTime,jdbcType=NVARCHAR}, + + + #{archivestate,jdbcType=NVARCHAR}, + + + #{admissionDateTime,jdbcType=NVARCHAR}, + + + #{deptAdmissionTo,jdbcType=NVARCHAR}, + + + #{checkDoctor,jdbcType=NVARCHAR}, + + + #{checkDatetime,jdbcType=NVARCHAR}, + + + #{checkedDoctor,jdbcType=NVARCHAR}, + + + #{checkedDatetime,jdbcType=NVARCHAR}, + + + #{lockinfo,jdbcType=NVARCHAR}, + + + #{doctorInCharge,jdbcType=NVARCHAR}, + + + #{idNo,jdbcType=NVARCHAR}, + + + #{dischargeDisposition,jdbcType=NVARCHAR}, + + + #{deptCodeLend,jdbcType=NVARCHAR}, + + + #{isscaned,jdbcType=NVARCHAR}, + + + #{firstInstance,jdbcType=NVARCHAR}, + + + + + update archive_master + + + patient_id = #{patientId,jdbcType=NVARCHAR}, + + + inp_no = #{inpNo,jdbcType=NVARCHAR}, + + + visit_id = #{visitId,jdbcType=NVARCHAR}, + + + name = #{name,jdbcType=NVARCHAR}, + + + sex = #{sex,jdbcType=NVARCHAR}, + + + dept_name = #{deptName,jdbcType=NVARCHAR}, + + + discharge_date_time = #{dischargeDateTime,jdbcType=NVARCHAR}, + + + ArchiveState = #{archivestate,jdbcType=NVARCHAR}, + + + admission_date_time = #{admissionDateTime,jdbcType=NVARCHAR}, + + + dept_admission_to = #{deptAdmissionTo,jdbcType=NVARCHAR}, + + + check_doctor = #{checkDoctor,jdbcType=NVARCHAR}, + + + check_datetime = #{checkDatetime,jdbcType=NVARCHAR}, + + + checked_doctor = #{checkedDoctor,jdbcType=NVARCHAR}, + + + checked_datetime = #{checkedDatetime,jdbcType=NVARCHAR}, + + + LockInfo = #{lockinfo,jdbcType=NVARCHAR}, + + + DOCTOR_IN_CHARGE = #{doctorInCharge,jdbcType=NVARCHAR}, + + + ID_NO = #{idNo,jdbcType=NVARCHAR}, + + + DISCHARGE_DISPOSITION = #{dischargeDisposition,jdbcType=NVARCHAR}, + + + dept_code_lend = #{deptCodeLend,jdbcType=NVARCHAR}, + + + isscaned = #{isscaned,jdbcType=NVARCHAR}, + + + is_scanning = #{isScanning,jdbcType=NVARCHAR}, + + + cmt_doctor = #{cmtDoctor,jdbcType=INTEGER}, + + + cmt_nurse = #{cmtNurse,jdbcType=INTEGER}, + + + doctor_name = #{doctorName,jdbcType=NVARCHAR}, + + + nurse_name = #{nurseName,jdbcType=NVARCHAR}, + + + cmt_doctor_date = #{cmtDoctorDate,jdbcType=NVARCHAR}, + + + cmt_doctor_date=null, + + + cmt_nurse_date = #{cmtNurseDate,jdbcType=NVARCHAR}, + + + cmt_nurse_date=null, + + + first_instance=#{firstInstance,jdbcType=NVARCHAR}, + + + score=#{score,jdbcType=NVARCHAR}, + + + is_sign=#{isSign,jdbcType=INTEGER}, + + + signer=#{signer,jdbcType=NVARCHAR}, + + + sign_time=#{signTime,jdbcType=NVARCHAR} + + + where id = #{id,jdbcType=NVARCHAR} + + update archive_master set patient_id = #{patientId,jdbcType=NVARCHAR}, inp_no = #{inpNo,jdbcType=NVARCHAR}, @@ -1314,232 +1314,402 @@ bed_number=#{bedNumber,jdbcType=NVARCHAR} where id = #{id,jdbcType=NVARCHAR} - - - + SELECT m.id + ,m.patient_id + ,m.inp_no + ,m.visit_id + ,m.name + ,m.sex + ,g.name dept_name + ,CONVERT(varchar(10),m.discharge_date_time, 120)discharge_date_time + ,m.ArchiveState + ,CONVERT(varchar(10),m.admission_date_time, 120)admission_date_time + ,d.name dept_admission_to + ,m.check_doctor + ,m.check_datetime + ,m.checked_doctor + ,m.checked_datetime + ,m.LockInfo + ,m.DOCTOR_IN_CHARGE + ,m.ID_NO + ,m.DISCHARGE_DISPOSITION + ,m.dept_code_lend + ,m.cmt_doctor + ,m.cmt_nurse + ,m.doctor_name + ,m.nurse_name + ,m.cmt_doctor_date + ,m.cmt_nurse_date + ,m.emr_doctor_cmt + ,m.emr_nure_cmt + ,m.death_flag + ,m.first_instance + ,m.transfer_dept + ,m.IsScaned + ,m.bed_number + ,m.is_scanning + ,f.id as fid + ,f.following_type + ,f.following_content + ,CONVERT(varchar(10),f.handle_time, 120)handle_time + ,f.handle_id + ,f.handle_name + ,f.remark + FROM archive_master m + LEFT JOIN Archive_Master_Following f + on m.id=f.master_id + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) d + on m.dept_admission_to=d.code + LEFT JOIN (select code,name from emr_dictionary where parent_id=(select id from emr_dictionary where + typeCode='dept_code' )) g + on m.dept_name=g.code + where 1=1 and f.following_type in(8,9) + + and m.id = #{id,jdbcType=NVARCHAR} + + + and m.inp_no like '%'+#{inpNo,jdbcType=NCHAR}+'%' + + + and m.visit_id=#{visitId,jdbcType=NCHAR} + + + and m.name like '%'+#{name,jdbcType=NCHAR}+'%' + + + and m.dept_name in + + #{item} + + + + and f.handle_time = #{handleTime,jdbcType=NVARCHAR} + + + + and f.handle_time between CONVERT(VARCHAR(10),#{startHandleTime,jdbcType=NCHAR},120) and + #{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59' + + + and f.handle_time >= CONVERT(VARCHAR(10),#{startHandleTime,jdbcType=NCHAR},120) + + + and f.handle_time <= #{endHandleTime,jdbcType=NCHAR}+ ' 23:59:59' + + + + and f.handle_id in + + #{item} + + + + and f.following_type = #{followingType,jdbcType=NVARCHAR} + + ORDER BY f.handle_time desc + + + - - + + + + + + + + - - - - + + - - + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/copyDir/copyCountList.jsp b/src/main/webapp/WEB-INF/views/copyDir/copyCountList.jsp new file mode 100644 index 00000000..9e730998 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/copyDir/copyCountList.jsp @@ -0,0 +1,384 @@ +<%@ page import="java.util.ResourceBundle" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + +<% + ResourceBundle res = ResourceBundle.getBundle("config.jdbc"); +%> +<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%> + + + 复印记录统计 + + + + + + <%@include file="../../jspf/comm.jspf" %> + + + +
+ +
+
+ +
+ + +
+ +
+ + +
+
+ +
+ + - + +
+
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/copyDir/copyDetailList.jsp b/src/main/webapp/WEB-INF/views/copyDir/copyDetailList.jsp new file mode 100644 index 00000000..10209856 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/copyDir/copyDetailList.jsp @@ -0,0 +1,422 @@ +<%@ page import="java.util.ResourceBundle" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + +<% + ResourceBundle res = ResourceBundle.getBundle("config.jdbc"); +%> +<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%> + + + 复印记录明细 + + + + + + <%@include file="../../jspf/comm.jspf" %> + + + +
+ +
+
+ +
+ + +
+ + <%--
+ + +
--%> +
+ +
+ + - + +
+
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp index 07ede5e6..2e27eb07 100644 --- a/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp +++ b/src/main/webapp/WEB-INF/views/medicalRecordStorageDir/MedicalRecordStorage.jsp @@ -366,7 +366,7 @@ limit = currPageSize; this.pageSize = currPageSize; } - console.log("-=======startDate===="+$("#startDateTo").val()); + //console.log("-=======startDate===="+$("#startDateTo").val()); var temp = { limit: limit, //页面大小 diff --git a/src/main/webapp/WEB-INF/views/scanDir/scanCountList.jsp b/src/main/webapp/WEB-INF/views/scanDir/scanCountList.jsp new file mode 100644 index 00000000..954d9737 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/scanDir/scanCountList.jsp @@ -0,0 +1,392 @@ +<%@ page import="java.util.ResourceBundle" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + +<% + ResourceBundle res = ResourceBundle.getBundle("config.jdbc"); +%> +<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%> + + + 复印记录统计 + + + + + + <%@include file="../../jspf/comm.jspf" %> + + + +
+ +
+
+ <%--
+ + +
+ + - + +
+
--%> +
+ +
+ + - + +
+
+
+ + +
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ + + + \ No newline at end of file diff --git a/src/main/webapp/WEB-INF/views/scanDir/scanDetailList.jsp b/src/main/webapp/WEB-INF/views/scanDir/scanDetailList.jsp new file mode 100644 index 00000000..69b99949 --- /dev/null +++ b/src/main/webapp/WEB-INF/views/scanDir/scanDetailList.jsp @@ -0,0 +1,423 @@ +<%@ page import="java.util.ResourceBundle" %> +<%@ page contentType="text/html;charset=UTF-8" language="java" %> +<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> + +<% + ResourceBundle res = ResourceBundle.getBundle("config.jdbc"); +%> +<%--<%@ include file="/WEB-INF/jspf/common.jspf" %>--%> + + + 复印记录统计 + + + + + + <%@include file="../../jspf/comm.jspf" %> + + + +
+ +
+
+ +
+ + +
+ +
+ + +
+
+ +
+ + - + +
+
+
+ + +
+ + +
+
+ +
+
+
+
+ +
+ +
+
+
+ + + + \ No newline at end of file