|
|
|
@ -941,12 +941,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
public int deleteWeaklyByPropertyIn(String propName, Object[] propValues,String username) {
|
|
|
|
|
if(propValues != null && propValues.length > 0){
|
|
|
|
|
String hql = "update " + persistentClass.getName()
|
|
|
|
|
+ " model set model.isDeleted = :isDeleted,model.modifyUser= :modifyUser,model.modifyDatetime=:modifyDatetime where model."
|
|
|
|
|
+ " model set model.isDeleted =:modelIsDeleted,model.modifyUser=:modelModifyUser,model.modifyDatetime=:modelModifyDatetime where model."
|
|
|
|
|
+ propName + " in(:"+propName+") ";
|
|
|
|
|
Query query = entityManager.createQuery(hql);
|
|
|
|
|
query.setParameter("isDeleted",CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
query.setParameter("modifyUser",username);
|
|
|
|
|
query.setParameter("modifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("modelIsDeleted",CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
query.setParameter("modelModifyUser",username);
|
|
|
|
|
query.setParameter("modelModifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter(propName, Arrays.asList(propValues));
|
|
|
|
|
|
|
|
|
|
return query.executeUpdate();
|
|
|
|
@ -963,12 +963,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
public int deleteWeaklyByProperties(String[] propName, Object[] propValue,String username) {
|
|
|
|
|
if ((propName != null) && (propName.length > 0) && (propValue != null) && (propValue.length > 0) && (propValue.length == propName.length)) {
|
|
|
|
|
StringBuffer sb = new StringBuffer("update " + persistentClass.getName()
|
|
|
|
|
+ " model set model.isDeleted = :isDeleted,model.modifyUser= :modifyUser,model.modifyDatetime=:modifyDatetime where 1=1 ");
|
|
|
|
|
+ " model set model.isDeleted = :modelDeleted,model.modifyUser= :modelModifyUser,model.modifyDatetime=:modelModifyDatetime where 1=1 ");
|
|
|
|
|
appendQL(sb,propName,propValue);
|
|
|
|
|
Query query = entityManager.createQuery(sb.toString());
|
|
|
|
|
query.setParameter("modifyUser",username);
|
|
|
|
|
query.setParameter("modifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("isDeleted",CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
query.setParameter("modelModifyUser",username);
|
|
|
|
|
query.setParameter("modelModifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("modelDeleted",CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue());
|
|
|
|
|
|
|
|
|
|
setParameter(query,propName,propValue);
|
|
|
|
|
|
|
|
|
@ -1001,12 +1001,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
public int updateValidStatusByPropertyIn(String propName, Object[] propValues,int status,String username) {
|
|
|
|
|
if(propValues != null && propValues.length > 0){
|
|
|
|
|
String hql = "update " + persistentClass.getName()
|
|
|
|
|
+ " model set model.isValid = :isValid ,model.modifyUser= :modifyUser,model.modifyDatetime=:modifyDatetime where model."
|
|
|
|
|
+ " model set model.isValid =:modelIsValid ,model.modifyUser=:modelModifyUser,model.modifyDatetime=:modelModifyDatetime where model."
|
|
|
|
|
+ propName + " in(:"+propName+") ";
|
|
|
|
|
Query query = entityManager.createQuery(hql);
|
|
|
|
|
query.setParameter("modifyUser",username);
|
|
|
|
|
query.setParameter("modifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("isValid",status);
|
|
|
|
|
query.setParameter("modelModifyUser",username);
|
|
|
|
|
query.setParameter("modelModifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("modelIsValid",status);
|
|
|
|
|
query.setParameter(propName, Arrays.asList(propValues));
|
|
|
|
|
|
|
|
|
|
return query.executeUpdate();
|
|
|
|
@ -1023,12 +1023,12 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
|
|
|
|
|
public int updateValidStatusByProperties(String[] propName, Object[] propValue,int status,String username) {
|
|
|
|
|
if ((propName != null) && (propName.length > 0) && (propValue != null) && (propValue.length > 0) && (propValue.length == propName.length)) {
|
|
|
|
|
StringBuffer sb = new StringBuffer("update " + persistentClass.getName()
|
|
|
|
|
+ " model set model.isValid = :isValid,model.modifyUser= :modifyUser,model.modifyDatetime=:modifyDatetime where 1=1 ");
|
|
|
|
|
+ " model set model.isValid = :modelIsValid,model.modifyUser= :modelModifyUser,model.modifyDatetime=:modelModifyDatetime where 1=1 ");
|
|
|
|
|
appendQL(sb,propName,propValue);
|
|
|
|
|
Query query = entityManager.createQuery(sb.toString());
|
|
|
|
|
query.setParameter("modifyUser",username);
|
|
|
|
|
query.setParameter("modifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("isValid",status);
|
|
|
|
|
query.setParameter("modelModifyUser",username);
|
|
|
|
|
query.setParameter("modelModifyDatetime",getNowTime(true));
|
|
|
|
|
query.setParameter("modelIsValid",status);
|
|
|
|
|
|
|
|
|
|
setParameter(query,propName,propValue);
|
|
|
|
|
|
|
|
|
|