public Integer getDangerCategoryByParameters(Integer constructionTypeId,Integer defectZoneId,Integer defectTypeId,Integer defectVarityId, List parameterList){
String queryParameter="";
String queryCondition="";
for (int i = 0; i < parameterList.size(); i++) {
DefectParameter defectParameter = (DefectParameter) parameterList.get(i);
queryParameter+="left join fetch defectCategory.categoryParameters as categoryParameters"+i+" ";
if(i==0){
queryCondition+=" AND ";
if(parameterList.size()!=1){
queryCondition+="(";
}
}
else{
queryCondition+=" OR ";
}
queryCondition+=" (categoryParameters"+i+".parameter.parameterId="+defectParameter.getParameter().getParameterId()+" AND categoryParameters"+i+".parameterValue>="+defectParameter.getParameterValue()+" AND categoryParameters"+i+".parameterBeginValue<="+defectParameter.getParameterValue()+" AND (NOT categoryParameters"+i+".parameterValue=1000000 )) ";
if(i==parameterList.size()-1 && parameterList.size()!=1){
queryCondition+=")";
}
}