yun-zuoyi
amy 7 years ago
parent b456f6c2f5
commit 11dcd6be3a

@ -492,4 +492,27 @@ public class CommonEnumUtil {
}
}
/**
*
*/
public enum OPEN_CLOSE {
OPEN(1, "启用"),
CLOSE(2, "禁用");
private int value;
private String description;
public int getValue() {
return value;
}
public String getDescription() {
return description;
}
OPEN_CLOSE(int value, String description) {
this.value = value;
this.description = description;
}
}
}

@ -128,6 +128,13 @@ public interface BaseRepository <T, ID extends Serializable> extends JpaReposito
public int updateByHqlWhere(String hqlWhere,String propertyName, Object propertyValue);
/**
*
* @param ids
* @return
*/
public boolean deleteWeaklyByIds(Long[] ids) ;
/**
*
* @param hqlWhere HQL where
* @param propertyName
@ -226,4 +233,6 @@ public interface BaseRepository <T, ID extends Serializable> extends JpaReposito
public List<Object[]> findBySqlObjList(String sql);
public List<Object[]> findBySqlObjListByPager(String sql,Pager pager);
}

@ -777,6 +777,28 @@ public class BaseRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRep
}
/**
*
* @param ids
* @return
*/
@Override
public boolean deleteWeaklyByIds(Long[] ids) {
if(ids != null && ids.length > 0){
String hql = "update " + persistentClass.getName() + " model where model.id in(:ids) ";
Query query = entityManager.createQuery(hql);
query.setParameter("ids", Arrays.asList(ids));
int delResult = query.executeUpdate();
if (delResult == ids.length) {
return true;
}
}else{
throw new IllegalArgumentException("Method deleteByPropertiesIn argument is illegal! ids:" + ids);
}
return false;
}
/**
*
* @param item
* @return

@ -1,3 +1,4 @@
/*
package cn.estsh.i3plus.pojo.platform.repository;
import cn.estsh.i3plus.pojo.base.jpa.dao.BaseMongoRepository;
@ -5,12 +6,15 @@ import cn.estsh.i3plus.pojo.base.jpa.dao.BaseRepository;
import cn.estsh.i3plus.pojo.platform.bean.LogOperate;
import org.springframework.data.mongodb.repository.MongoRepository;
*/
/**
* @Description : (使Mongodb)
* @Reference :
* @Author : wei.peng
* @Date : 2018-10-22 12:03:00.118
* @Modify :
**/
**//*
public interface LogOperateRepository extends BaseMongoRepository<LogOperate, Long> {
}
*/

@ -14,39 +14,28 @@ import javax.persistence.Table;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-09-04 15:58
* @Author : amy
* @CreateDate : 2018-11-06 15:58
* @Modify:
**/
@Data
@Entity
@DynamicInsert
@DynamicUpdate
@Table(name="T_WMS_WAREHOUSE")
@Table(name="WMS_WAREHOUSE")
@Api("工厂仓库信息")
public class WareHouse extends BaseBean {
@Column(name="code")
@Column(name="CODE")
@ApiParam("仓库代码")
public String code;
@Column(name="name")
@Column(name="NAME")
@ApiParam("仓库名称")
public String name;
@Column(name="address")
@Column(name="ADDRESS")
@ApiParam("仓库地址")
public String address;
@Column(name="telephone")
@ApiParam("仓库电话号码")
public String telephone;
@Column(name="fax")
@ApiParam("仓库传真号码")
public String fax;
@Column(name="contact")
@ApiParam("联系人")
public String contact;
}

@ -7,8 +7,8 @@ import org.springframework.stereotype.Repository;
/**
* @Description :
* @Reference :
* @Author : alwaysfrin
* @CreateDate : 2018-09-13 9:47
* @Author : amy
* @CreateDate : 2018-11-06 9:47
* @Modify:
**/
@Repository

@ -1,5 +1,6 @@
package cn.estsh.i3plus.pojo.wms.sqlpack;
import cn.estsh.i3plus.pojo.base.enumutil.CommonEnumUtil;
import cn.estsh.i3plus.pojo.base.tool.HqlPack;
import cn.estsh.i3plus.pojo.wms.bean.*;
import cn.estsh.i3plus.pojo.wms.bean.InterfaceDevice;
@ -121,4 +122,18 @@ public class WmsHqlPack {
return result.toString();
}
/**
*
* @param wareHouse
* @return
*/
public static String packHqlWareHouse(WareHouse wareHouse) {
StringBuffer result = new StringBuffer();
HqlPack.getStringLikerPack(wareHouse.getAddress(), "address", result);
HqlPack.getStringLikerPack(wareHouse.getCode(), "code", result);
HqlPack.getStringLikerPack(wareHouse.getName(), "name", result);
HqlPack.getStringEqualPack(CommonEnumUtil.TRUE_OR_FALSE.TRUE.getValue()+"","isValid",result);
return result.toString();
}
}

Loading…
Cancel
Save