From 25b7e040153e96fd7c9f649e9b0de8932e1a2a00 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期二, 13 八月 2019 15:47:33 +0800 Subject: [PATCH] Merge branch 'mater-1.6.0' into div --- fanli/src/main/java/com/yeshi/fanli/dao/taobao/TLJBuyGoodsDao.java | 14 ++++++++++++-- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/dao/taobao/TLJBuyGoodsDao.java b/fanli/src/main/java/com/yeshi/fanli/dao/taobao/TLJBuyGoodsDao.java index 5bb02f2..99f68e7 100644 --- a/fanli/src/main/java/com/yeshi/fanli/dao/taobao/TLJBuyGoodsDao.java +++ b/fanli/src/main/java/com/yeshi/fanli/dao/taobao/TLJBuyGoodsDao.java @@ -12,17 +12,27 @@ @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); -- Gitblit v1.8.0