|
|
|
@ -1020,12 +1020,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public double countSumByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
|
|
|
|
|
return countSumByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
|
|
|
|
|
public double findSumByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
|
|
|
|
|
return findSumByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public double countSumByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
|
|
|
|
|
public double findSumByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
|
|
|
|
|
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
|
|
|
|
|
StringBuffer sb = new StringBuffer("select sum(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
|
|
|
|
|
appendQL(sb,paramName,paramValue);
|
|
|
|
@ -1044,12 +1044,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public double countAvgByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
|
|
|
|
|
return countAvgByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
|
|
|
|
|
public double findAvgByProperty(String sumPropertyName, String groupByName, String propertyName, Object value) {
|
|
|
|
|
return findAvgByProperties(sumPropertyName,groupByName,new String[]{propertyName},new Object[]{value});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public double countAvgByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
|
|
|
|
|
public double findAvgByProperties(String sumPropertyName, String groupByName, String[] paramName, Object[] paramValue) {
|
|
|
|
|
if ((paramName != null) && (paramName.length > 0) && (paramValue != null) && (paramValue.length > 0)) {
|
|
|
|
|
StringBuffer sb = new StringBuffer("select avg(:"+sumPropertyName+") from " + persistentClass.getName() + " model where 1=1 ");
|
|
|
|
|
appendQL(sb,paramName,paramValue);
|
|
|
|
|