use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class BillServiceImpl 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 BillServiceImpl method getProductMapByEnterpriseId.
/**
* 根据企业id查询订单表中对应的产品Manp
*
* @param enterprise
* @return
*/
public Map<Long, Product> getProductMapByEnterpriseId(Long enterprise) {
Map<Long, Product> productMap = new HashMap<Long, Product>();
List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.BillMapper.selectProductsByEnterprise", enterprise);
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 BillServiceImpl method getProductMapByBills.
/**
* 根据订单list获取对应产品Map
*
* @param bills
* @return
*/
public Map<Long, Product> getProductMapByBills(List<Bill> bills) {
Map<Long, Product> productMap = new HashMap<Long, Product>();
List<Long> productIds = new ArrayList<Long>();
for (Bill 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;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getKeyUnlockProductIds.
/**
* 获取所有的解锁产品的ID
* @return
*/
public List<Long> getKeyUnlockProductIds() {
List<Long> list = new ArrayList<>();
List<Product> products = new ArrayList<>();
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andKeyUnlockTypeIsNotNull();
products = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
if (null == products || products.isEmpty()) {
return null;
}
for (Product product : products) {
list.add(product.getId());
}
return list;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class MakeSealServerServiceImpl method getProduct.
/**
* 根据签章服务id,查找关联的产品
*
* @param makeSealServerId
* @return
*/
private List<Product> getProduct(Long makeSealServerId) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andMakeSealServerEqualTo(makeSealServerId);
return sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
}
Aggregations