| | |
| | |
|
| | | @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) {
|
| | |
| | | }
|
| | |
|
| | | /**
|
| | | * 根据商品ID删除
|
| | | * |
| | | * @param auctionId
|
| | | */
|
| | | public void deleteByAuctionId(Long auctionId) {
|
| | | Query query = new Query();
|
| | | Criteria ca = Criteria.where("goods.auctionId").is(auctionId);
|
| | | query.addCriteria(ca);
|
| | | mongoTemplate.findAndRemove(query, TLJBuyGoods.class);
|
| | | }
|
| | |
|
| | | /**
|
| | | * 减红包个数
|
| | | *
|
| | | * @param id
|