Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_sqlserver.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_sqlserver.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_sqlserver.sql (revision 17722) @@ -0,0 +1,46 @@ +--升级TousseDefinition表的includeImplant字段 +update TousseDefinition set includeImplant=0 +where id in ( + select distinct case when md.isImplant='是' then td.id else 0 end + from TousseDefinition td + inner join MaterialInstance mi on mi.tousse_id=td.id + inner join MaterialDefinition md on md.id=mi.materialDefinition_id +) and (includeImplant is null or includeImplant<>0); +update TousseDefinition set includeImplant=1 +where id not in ( + select distinct case when md.isImplant='是' then td.id else 0 end + from TousseDefinition td + inner join MaterialInstance mi on mi.tousse_id=td.id + inner join MaterialDefinition md on md.id=mi.materialDefinition_id +) and (includeImplant is null or includeImplant<>1); +--升级TousseInstance表的isRoutine字段 +update TousseInstance set isRoutine='否' +where id in( + select ti.id + from TousseInstance ti + join TousseDefinition td on td.id=ti.tousseDefinition_id + join SterilizationRecord sr on sr.id=ti.sterilizationRecord_id + join Sterilizer s on s.id=sr.sterilizer_id + where td.includeImplant=0 + and ti.invoiceSendTime is not null + and ( + sr.biologyResult='不合格' + or (sr.biologicalMonitoringEndDate is not null and sr.biologicalMonitoringEndDate > ti.invoiceSendTime) + or (sr.biologicalMonitoringEndDate is null and s.lagTime is not null and s.biologicalMonitoringTime is not null and dateadd(minute,(s.lagTime+s.biologicalMonitoringTime),sr.endDate) > ti.invoiceSendTime) + ) +) and (isRoutine is null or isRoutine<>'否'); +update TousseInstance set isRoutine='是' +where id in( + select ti.id + from TousseInstance ti + join TousseDefinition td on td.id=ti.tousseDefinition_id + join SterilizationRecord sr on sr.id=ti.sterilizationRecord_id + join Sterilizer s on s.id=sr.sterilizer_id + where td.includeImplant=0 + and ti.invoiceSendTime is not null + and (sr.biologyResult is null or sr.biologyResult<>'不合格') + and ( + (sr.biologicalMonitoringEndDate is not null and sr.biologicalMonitoringEndDate < ti.invoiceSendTime) + or (sr.biologicalMonitoringEndDate is null and s.lagTime is not null and s.biologicalMonitoringTime is not null and dateadd(minute,(s.lagTime+s.biologicalMonitoringTime),sr.endDate) < ti.invoiceSendTime) + ) +) and (isRoutine is null or isRoutine<>'是'); \ No newline at end of file Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java =================================================================== diff -u -r17664 -r17722 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 17664) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/JasperReportManagerImpl.java (.../JasperReportManagerImpl.java) (revision 17722) @@ -11909,7 +11909,7 @@ + "inner join Sterilizer s on s.id=sr.sterilizer_id " + "left join UseRecord ur on ur.id=t.useRecord_id " - + "where md.isImplant = '是' " + + "where td.includeImplant = 0 " + "and sr.orgUnitCoding='" + departCoding + "' " + "and sr.endDate " + betweenSql + tempSql Index: forgon-core/src/main/java/com/forgon/Constants.java =================================================================== diff -u -r17715 -r17722 --- forgon-core/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 17715) +++ forgon-core/src/main/java/com/forgon/Constants.java (.../Constants.java) (revision 17722) @@ -21,7 +21,7 @@ "4.2.3","4.2.4","4.2.5","4.2.6","4.2.7","4.2.8","4.2.9","4.3.0","4.3.1","4.3.2","4.3.3","4.3.4","4.3.5","4.3.6","4.3.7","4.3.8","4.3.9", "4.4.0","4.4.1","4.4.2","4.4.3","4.4.4","4.4.5","4.4.6","4.4.7","4.4.8","4.4.9","4.5.0","4.5.1","4.5.2","4.5.3","4.5.4","4.5.5","4.5.6","4.5.7","4.5.8", "4.5.9","4.6.0","4.6.1","4.6.2","4.6.3","4.6.4","4.6.5","4.6.6","4.6.7","4.6.8","4.6.9","4.7.0","4.7.1","4.7.2","4.7.3","4.7.4","4.7.5","4.7.6","4.7.7", - "4.7.8","4.7.9","4.8.0"};// 版本列表 + "4.7.8","4.7.9","4.8.0","4.8.1"};// 版本列表 public final static List SOFTWARE_VERSION_LIST = Arrays .asList(SOFTWARE_VERSION_ARRAY); public final static String SOFTWARE_VERSION = SOFTWARE_VERSION_ARRAY[SOFTWARE_VERSION_ARRAY.length - 1];// 软件最新版本 Index: ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_oracle.sql =================================================================== diff -u --- ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_oracle.sql (revision 0) +++ ssts-web/src/main/webapp/dataUpdater/sqls/4.8.0_4.8.1_oracle.sql (revision 17722) @@ -0,0 +1,46 @@ +--升级TousseDefinition表的includeImplant字段 +update TousseDefinition set includeImplant=0 +where id in ( + select distinct case when md.isImplant='是' then td.id else 0 end + from TousseDefinition td + inner join MaterialInstance mi on mi.tousse_id=td.id + inner join MaterialDefinition md on md.id=mi.materialDefinition_id +) and (includeImplant is null or includeImplant<>0); +update TousseDefinition set includeImplant=1 +where id not in ( + select distinct case when md.isImplant='是' then td.id else 0 end + from TousseDefinition td + inner join MaterialInstance mi on mi.tousse_id=td.id + inner join MaterialDefinition md on md.id=mi.materialDefinition_id +) and (includeImplant is null or includeImplant<>1); +--升级TousseInstance表的isRoutine字段 +update TousseInstance set isRoutine='否' +where id in( + select ti.id + from TousseInstance ti + join TousseDefinition td on td.id=ti.tousseDefinition_id + join SterilizationRecord sr on sr.id=ti.sterilizationRecord_id + join Sterilizer s on s.id=sr.sterilizer_id + where td.includeImplant=0 + and ti.invoiceSendTime is not null + and ( + sr.biologyResult='不合格' + or (sr.biologicalMonitoringEndDate is not null and sr.biologicalMonitoringEndDate > ti.invoiceSendTime) + or (sr.biologicalMonitoringEndDate is null and s.lagTime is not null and s.biologicalMonitoringTime is not null and (sr.endDate+(s.lagTime+s.biologicalMonitoringTime)/24/60) > ti.invoiceSendTime) + ) +) and (isRoutine is null or isRoutine<>'否'); +update TousseInstance set isRoutine='是' +where id in( + select ti.id + from TousseInstance ti + join TousseDefinition td on td.id=ti.tousseDefinition_id + join SterilizationRecord sr on sr.id=ti.sterilizationRecord_id + join Sterilizer s on s.id=sr.sterilizer_id + where td.includeImplant=0 + and ti.invoiceSendTime is not null + and (sr.biologyResult is null or sr.biologyResult<>'不合格') + and ( + (sr.biologicalMonitoringEndDate is not null and sr.biologicalMonitoringEndDate < ti.invoiceSendTime) + or (sr.biologicalMonitoringEndDate is null and s.lagTime is not null and s.biologicalMonitoringTime is not null and (sr.endDate+(s.lagTime+s.biologicalMonitoringTime)/24/60) < ti.invoiceSendTime) + ) +) and (isRoutine is null or isRoutine<>'是'); \ No newline at end of file