@ -3,6 +3,7 @@ package cn.estsh.i3plus.pojo.base.jpa.daoimpl;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean ;
import cn.estsh.i3plus.pojo.base.bean.DdlPackBean ;
import cn.estsh.i3plus.pojo.base.common.Pager ;
import cn.estsh.i3plus.pojo.base.common.Pager ;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil ;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil ;
import cn.estsh.i3plus.pojo.base.enumutil.WmsEnumUtil ;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository ;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository ;
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker ;
import cn.estsh.i3plus.pojo.base.codemaker.SnowflakeIdMaker ;
import org.apache.commons.lang3.StringUtils ;
import org.apache.commons.lang3.StringUtils ;
@ -219,6 +220,7 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
/ * *
/ * *
* 更 新 参 数 汇 总 方 法
* 更 新 参 数 汇 总 方 法
*
* @param conditionName 条 件 属 性 名
* @param conditionName 条 件 属 性 名
* @param conditionValue 条 件 属 性 值
* @param conditionValue 条 件 属 性 值
* @param propertyName 更 新 属 性 名
* @param propertyName 更 新 属 性 名
@ -412,6 +414,34 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
}
}
@Override
@Override
public List < T > findByWasProperty ( String [ ] propertyNames , Object [ ] values ) {
if ( propertyNames . length ! = values . length ) {
throw new IllegalArgumentException ( "参数名的数量和参数值不匹配!propertyNames:" + propertyNames . length + ",values:" + values . length ) ;
}
StringBuffer queryString = new StringBuffer ( ) ;
queryString . append ( " select new " + persistentClass . getSimpleName ( ) + "(snStatus,whNo,locateNo,partNo,partNameRdd,lotNo,sum(qty)) from " + persistentClass . getSimpleName ( ) + " " ) ;
int size = propertyNames . length ;
if ( size > 0 ) {
queryString . append ( "where 1=1 and snStatus in ('" + WmsEnumUtil . STOCK_SN_STATUS . PRE_INSTOCK . getValue ( ) + "','" + WmsEnumUtil . STOCK_SN_STATUS . INSTOCKED . getValue ( ) + "','" + WmsEnumUtil . STOCK_SN_STATUS . PICKED . getValue ( ) + "','" + WmsEnumUtil . STOCK_SN_STATUS . QUALITY_CONTROL . getValue ( ) + "') " ) ;
}
for ( int i = 0 ; i < size ; i + + ) {
if ( values [ i ] ! = null ) {
queryString . append ( " and " + propertyNames [ i ] + "= :" + propertyNames [ i ] ) ;
}
}
queryString . append ( "/n group by lotNo,dateCode" ) ;
Query queryObject = entityManager . createQuery ( queryString . toString ( ) ) ;
for ( int i = 0 ; i < size ; i + + ) {
if ( values [ i ] ! = null ) {
queryObject . setParameter ( propertyNames [ i ] , values [ i ] ) ;
}
}
return queryObject . getResultList ( ) ;
}
@Override
public List < T > findByProperty ( String [ ] propertyNames , Object [ ] values ) {
public List < T > findByProperty ( String [ ] propertyNames , Object [ ] values ) {
if ( propertyNames . length ! = values . length ) {
if ( propertyNames . length ! = values . length ) {
throw new IllegalArgumentException ( "参数名的数量和参数值不匹配!propertyNames:" + propertyNames . length + ",values:" + values . length ) ;
throw new IllegalArgumentException ( "参数名的数量和参数值不匹配!propertyNames:" + propertyNames . length + ",values:" + values . length ) ;