| | |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | |
| | | public void updateSelective(BPushDeviceToken bean) { |
| | | Query query = new Query(); |
| | | Update update = new Update(); |
| | | query.addCriteria(Criteria.where("id").is(bean.getId())); |
| | | query.addCriteria(Criteria.where("_id").is(bean.getId())); |
| | | if (bean.getAppCode() != null) { |
| | | update.set("appCode", bean.getAppCode()); |
| | | } |
| | |
| | | andList.add(Criteria.where("updateTime").lt(daoQuery.maxUpdateTime)); |
| | | } |
| | | |
| | | if (daoQuery.token != null) { |
| | | andList.add(Criteria.where("token").lt(daoQuery.token)); |
| | | } |
| | | |
| | | Criteria[] ands = new Criteria[andList.size()]; |
| | | andList.toArray(ands); |
| | | |
| | |
| | | Query query = getQuery(daoQuery); |
| | | query.skip(start); |
| | | query.limit(count); |
| | | query.with(new Sort(new Sort.Order(Sort.Direction.ASC, "updateTime"))); |
| | | List<Sort.Order> orderList = new ArrayList<>(); |
| | | orderList.add(new Sort.Order(Sort.Direction.ASC, "updateTime")); |
| | | query.with(Sort.by(orderList)); |
| | | return findList(query); |
| | | } |
| | | |
| | |
| | | public List<String> uidList; |
| | | public List<String> deviceIdList; |
| | | public List<String> brandNameList; |
| | | public String token; |
| | | public Date minUpdateTime; |
| | | public Date maxUpdateTime; |
| | | public Date minCreateTime; |
| | | public Date maxCreateTime; |
| | | |
| | | } |
| | | } |