admin
2021-03-18 b37275dba6b782bf3bb3817c4504f6cdef1bef7c
src/main/java/com/yeshi/buwan/dao/recommend/HomeRecommendSpecialDao.java
@@ -35,12 +35,16 @@
        return findList(query);
    }
    public List<HomeRecommendSpecial> list(DaoQuery daoQuery) {
    private Query getQuery(DaoQuery daoQuery) {
        Query query = new Query();
        List<Criteria> andList = new ArrayList<>();
        if (daoQuery.systemId != null) {
            andList.add(Criteria.where("systemId").is(daoQuery.systemId));
        }
        if (daoQuery.key != null) {
            andList.add(Criteria.where("name").regex(daoQuery.key));
        }
        Criteria criteria = new Criteria();
@@ -51,12 +55,21 @@
        }
        query.addCriteria(criteria);
        return query;
    }
    public List<HomeRecommendSpecial> list(DaoQuery daoQuery) {
        Query query = getQuery(daoQuery);
        query.skip(daoQuery.start);
        query.limit(daoQuery.count);
        query.with(new Sort(new Sort.Order(Sort.Direction.DESC, "weight")));
        return findList(query);
    }
    public long count(DaoQuery daoQuery) {
        Query query = getQuery(daoQuery);
        return count(query);
    }
    public void updateSelective(HomeRecommendSpecial bean) {
@@ -87,6 +100,7 @@
        public String systemId;
        public int start;
        public int count;
        public String key;
    }