2 Revīzijas c56fa07911 ... 7ec32e0cb1

Autors SHA1 Ziņojums Datums
  suxiaoyang 7ec32e0cb1 Merge remote-tracking branch 'origin/dev' into dev 6 gadi atpakaļ
  suxiaoyang 11e9ea73eb 拼写错误 6 gadi atpakaļ

+ 5 - 4
mysql-starter/src/main/java/com/yihu/mysql/query/BaseJpaService.java

@ -162,10 +162,11 @@ public abstract class BaseJpaService<T, R extends CrudRepository> {
        Root<T> root = query.from(getEntityClass());
        List<Predicate> ls = new ArrayList<>();
        for(int i=0; i< fields.length; i++){
            if(values[i].getClass().isArray())
                ls.add(criteriaBuilder.in(root.get(fields[i]).in((Object[])values[i])));
            else
            if (values[i].getClass().isArray()) {
                ls.add(criteriaBuilder.in(root.get(fields[i]).in((Object[]) values[i])));
            } else {
                ls.add(criteriaBuilder.equal(root.get(fields[i]), values[i]));
            }
        }
        query.where(ls.toArray(new Predicate[ls.size()]));
        return entityManager
@ -342,7 +343,7 @@ public abstract class BaseJpaService<T, R extends CrudRepository> {
     * @param sorts
     * @return
     */
    public Pageable creatPage(Integer page, Integer size, String sorts){
    public Pageable createPage(Integer page, Integer size, String sorts){
        PageRequest pageRequest = null;
        if(null == page || page <= 0){
            page = defaultPage;