| | |
| | |
|
| | | @Repository
|
| | | public class TLJBuyGoodsDao extends MongodbBaseDao<TLJBuyGoods> {
|
| | | |
| | |
|
| | | public List<TLJBuyGoods> listByDayOrderByUpdateTime(String day, int page, int pageSize) {
|
| | | public List<TLJBuyGoods> listByDayOrderByUpdateTime(String appKey, String day, int page, int pageSize) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("day").is(day);
|
| | | if (appKey != null)
|
| | | ca = ca.and("appKey").is(appKey);
|
| | | query.addCriteria(ca);
|
| | | query.limit(pageSize);
|
| | | query.skip((page - 1) * pageSize).with(new Sort(Sort.Direction.DESC, "updateTime"));
|
| | | return mongoTemplate.find(query, TLJBuyGoods.class);
|
| | | }
|
| | |
|
| | | public long countByDayAndAppKey(String appKey, String day) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("day").is(day);
|
| | | if (appKey != null)
|
| | | ca = ca.and("appKey").is(appKey);
|
| | | query.addCriteria(ca);
|
| | | return mongoTemplate.count(query, TLJBuyGoods.class);
|
| | | }
|
| | |
|
| | | public void deleteByGoodsId(Long goodsId) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("goods.auctionId").is(goodsId);
|