admin
2020-04-13 dd5b15229cb15459fa7c31ccea77dac28cbfafbd
fanli/src/main/java/com/yeshi/fanli/dao/dynamic/GoodsEvaluateDao.java
@@ -35,6 +35,21 @@
      mongoTemplate.save(record);
   }
   /**
    * 删除
    * @param record
    */
   public void remove(GoodsEvaluate record) {
      if (record == null) {
         return;
      }
      mongoTemplate.remove(record);
   }
   /**
    * 根据id查询数据
    * 
@@ -110,7 +125,7 @@
      query.addCriteria(Criteria.where("startTime").lte(now));
      query.addCriteria(Criteria.where("endTime").gte(now));
        query.skip(start).limit(count);
      query.with(new Sort(Sort.Direction.DESC,"weight")).with(new Sort(Sort.Direction.DESC,"createTime"));
      query.with(new Sort(Sort.Direction.DESC,"weight")).with(new Sort(Sort.Direction.DESC,"startTime"));
      return mongoTemplate.find(query, GoodsEvaluate.class);
   }
@@ -157,9 +172,24 @@
      Query query = new Query();
      query.addCriteria(Criteria.where("dynamicType").is(1));
      query.addCriteria(Criteria.where("state").is(1));
      query.addCriteria(Criteria.where("goods.goodsId").is(goodsId));
      query.addCriteria(Criteria.where("goods.goodsType").is(goodsType));
      query.addCriteria(Criteria.where("imgList.goods.goodsId").is(goodsId));
      query.addCriteria(Criteria.where("imgList.goods.goodsType").is(goodsType));
      return mongoTemplate.find(query, GoodsEvaluate.class);
   }
   /**
    * 查询有效
    * @param start
    * @param count
    * @param key
    * @return
    */
   public List<GoodsEvaluate> queryOverdue() {
      Date now = new Date();
      Query query = new Query();
      query.addCriteria(Criteria.where("endTime").lte(now));
      query.with(new Sort(Sort.Direction.ASC,"createTime"));
      return mongoTemplate.find(query, GoodsEvaluate.class);
   }
}