示例#1
0
 /**
  * 检查客户名称是否重复
  *
  * @param name 客户名称
  * @return
  */
 public int countBy(String name) {
   Map<String, Object> searchParams = new HashMap<>();
   searchParams.put("EQ_name", name);
   searchParams.put("EQ_custType", Constants.CustType.CUST_ADV);
   Specification<Customer> spec = JPAUtil.buildSpecification(searchParams);
   return (int) getDao().count(spec);
 }
示例#2
0
  public Page<Customer> find(Map<String, Object> searchParams, int page, int size, String sort) {
    Pageable pageable = JPAUtil.buildPageRequest(page, size, sort);
    Specification<Customer> spec = JPAUtil.buildSpecification(searchParams);

    return getDao().findAll(spec, pageable);
  }