Пример #1
0
 public List<Cart> queryCartList() {
   Long userId = UserThreadLocal.get().getId();
   Example example = new Example(Cart.class);
   example.setOrderByClause("created DESC");
   example.createCriteria().andEqualTo("userId", userId);
   List<Cart> cartList = cartDao.selectByExample(example);
   return cartList;
 }
Пример #2
0
 public List<Cart> queryCartList(Long userId) {
   Example example = new Example(Cart.class);
   example.setOrderByClause("created DESC");
   example.createCriteria().andEqualTo("userId", userId);
   return this.cartDao.selectByExample(example);
 }