admin
2021-07-30 19533a17aa55fafc70d0a385928e785cb50e1ebc
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,27 @@
        }
        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 HomeRecommendSpecial selectByDataKey(String dataKey) {
        Query query = new Query();
        query.addCriteria(Criteria.where("dataKey").is(dataKey));
        return findOne(query);
    }
    public long count(DaoQuery daoQuery) {
        Query query = getQuery(daoQuery);
        return count(query);
    }
    public void updateSelective(HomeRecommendSpecial bean) {
@@ -87,6 +106,7 @@
        public String systemId;
        public int start;
        public int count;
        public String key;
    }