Index: ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/dataindex/DataIndex.java =================================================================== diff -u -r30680 -r30685 --- ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/dataindex/DataIndex.java (.../DataIndex.java) (revision 30680) +++ ssts-reports/src/main/java/com/forgon/disinfectsystem/jasperreports/service/dataindex/DataIndex.java (.../DataIndex.java) (revision 30685) @@ -721,7 +721,7 @@ case "年度报表中的配包数量(按材料)": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -793,7 +793,7 @@ case "检查数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -864,7 +864,7 @@ case "包装数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -903,7 +903,7 @@ case "审核数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -948,7 +948,7 @@ break; case "灭菌数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -994,7 +994,7 @@ case "发货数量": String miCountSql = null; if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - miCountSql = "ti.materialAmount"; + miCountSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ miCountSql = "mi.count"; @@ -1059,7 +1059,7 @@ case "年度报表中的发货数量(按材料)": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -1103,7 +1103,7 @@ case "核对数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count"; @@ -1162,7 +1162,7 @@ case "下送数量": if(dataSoureOfMaterialsCountOfToussesInReports == 3){ - amountColumnSql = "ti.materialAmount"; + amountColumnSql = "case when ti.materialAmount is null then 0 else ti.materialAmount end + case when ti.disposableGoodAmount is null then 0 else ti.disposableGoodAmount end"; joinMaterialInstanceSql = ""; }else{ amountColumnSql = "mi.count";