use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class PersonalBillServiceImpl method getProductMapByUserInfoId.
/**
* 根据用户id查询订单表中对应的产品Map
*
* @param userInfo
* @return
*/
public Map<Long, Product> getProductMapByUserInfoId(Long userInfo) {
Map<Long, Product> productMap = new HashMap<Long, Product>();
List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductsByUserInfo", userInfo);
if (null != productIds && !productIds.isEmpty()) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andIdIn(productIds);
productMap = sqlSession.selectMap("com.itrus.portal.db.ProductMapper.selectByExample", example, "id");
}
return productMap;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class PersonalBillServiceImpl method getProductMapByBills.
/**
* 根据订单list获取对应产品Map
*
* @param bills
* @return
*/
public Map<Long, Product> getProductMapByBills(List<PersonalBill> bills) {
Map<Long, Product> productMap = new HashMap<Long, Product>();
List<Long> productIds = new ArrayList<Long>();
for (PersonalBill bill : bills) {
productIds.add(bill.getProduct());
}
if (!productIds.isEmpty()) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andIdIn(productIds);
productMap = sqlSession.selectMap("com.itrus.portal.db.ProductMapper.selectByExample", example, "id");
}
return productMap;
}
Aggregations