|
@@ -307,7 +307,14 @@ public class personnelstatistics extends Controller {
|
|
|
if(isJSONObject(statisticaldimension)){
|
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(statisticaldimension);
|
|
|
if(!jsonObjectResult.isEmpty()){
|
|
|
- where1= where1+ " and (t1.class in"+ jsonObjectResult.get("type")+" or t1.subclass in"+ jsonObjectResult.get("mx")+")";
|
|
|
+ StringBuffer stringBuffer= new StringBuffer();
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("type")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.class in"+ jsonObjectResult.get("type"));
|
|
|
+ }
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
|
|
|
+ }
|
|
|
+ where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
|
|
|
where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
}
|
|
|
|
|
@@ -575,7 +582,14 @@ public class personnelstatistics extends Controller {
|
|
|
if(isJSONObject(statisticaldimension)){
|
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(statisticaldimension);
|
|
|
if(!jsonObjectResult.isEmpty()){
|
|
|
- where1= where1+ " and (t1.class in"+ jsonObjectResult.get("type")+" or t1.subclass in"+ jsonObjectResult.get("mx")+")";
|
|
|
+ StringBuffer stringBuffer= new StringBuffer();
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("type")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.class in"+ jsonObjectResult.get("type"));
|
|
|
+ }
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
|
|
|
+ }
|
|
|
+ where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
|
|
|
where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
}
|
|
|
|
|
@@ -817,7 +831,14 @@ public class personnelstatistics extends Controller {
|
|
|
if(isJSONObject(statisticaldimension)){
|
|
|
JSONObject jsonObjectResult = JSONObject.parseObject(statisticaldimension);
|
|
|
if(!jsonObjectResult.isEmpty()){
|
|
|
- where1= where1+ " and (t1.class in"+ jsonObjectResult.get("type")+" or t1.subclass in"+ jsonObjectResult.get("mx")+")";
|
|
|
+ StringBuffer stringBuffer= new StringBuffer();
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("type")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.class in"+ jsonObjectResult.get("type"));
|
|
|
+ }
|
|
|
+ if(!((JSONArray)jsonObjectResult.get("mx")).isEmpty()){
|
|
|
+ stringBuffer.append(" or t1.subclass in"+ jsonObjectResult.get("mx"));
|
|
|
+ }
|
|
|
+ where1= where1+ " and ("+(stringBuffer.toString()).replaceFirst("or", "")+")";
|
|
|
where1 = where1.replace("[", "(").replace("]", ")");
|
|
|
}
|
|
|
|