| | |
| | | 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(); |
| | |
| | | } |
| | | |
| | | 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) { |
| | |
| | | public String systemId; |
| | | public int start; |
| | | public int count; |
| | | public String key; |
| | | } |
| | | |
| | | |