sb.append("`a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append("`a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv v WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append(" and depart_id in ("+inSqlPart+") ");
}
...
...
@@ -141,16 +141,16 @@ public class ReportViewUtil {
itemIds=itemIds.substring(1);
}
sb.append("`a`.`depart_id` AS `depart_id`,`a`.`data_id` AS `id`,`a`.`data_time` AS `time` from (( ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
if(StringUtils.isNotEmpty(departIds)){
sb.append("and depart_id in ("+inSqlPart+")");
sb.append("and depart_id in ("+inSqlPart+")");
}
if(!StringUtils.isEmpty(dataTime)){
sb.append("and data_time like'"+dataTime+"%'");
}
sb.append("and reit_id in ("+itemIds+")");
sb.append("and reit_id in ("+itemIds+")");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`data_id`,`a`.`depart_id`,`a`.`data_time` order by `a`.`data_time`)");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`data_id`,`a`.`depart_id`,`a`.`data_time` order by `a`.`data_time`)");
returnsb.toString();
}
...
...
@@ -204,17 +204,17 @@ public class ReportViewUtil {
sb.append("SELECT data_id,reit_id,item_value,data_time,depart_id FROM f_report_itemv WHERE 1=1 ");
if(!StringUtils.isEmpty(departIds)){
sb.append(" and depart_id in ("+inSqlPart+")");
sb.append(" and depart_id in ("+inSqlPart+")");
}
if(!StringUtils.isEmpty(startTime)){
sb.append("and data_time >='"+startTime+"'");
sb.append(" and data_time >='"+startTime+"' ");
}
if(!StringUtils.isEmpty(endTime)){
sb.append("and data_time <='"+endTime+"'");
sb.append(" and data_time <='"+endTime+"' ");
}
sb.append("and reit_id in ("+itemIds+")");
sb.append(" and reit_id in ("+itemIds+") ");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`depart_id`)");
sb.append(") `a` left join `f_report_item` `d` on((`a`.`reit_id` = `d`.`id`))) where 1=1 group by `a`.`depart_id`)");