use of com.itrus.portal.db.ExtraProductSpecExample in project portal by ixinportal.
the class ExtraProductSpecServiceImpl method getProductSpec.
/**
* 获取订单list对应的规格Map
*
* @param billList
* @return
*/
public Map<Long, ExtraProductSpec> getProductSpec(List<ExtraBill> billList) {
Map<Long, ExtraProductSpec> productSpecMap = new HashMap<Long, ExtraProductSpec>();
List<Long> productSpecIds = new ArrayList<Long>();
for (ExtraBill bill : billList) {
if (null != bill.getExtraProductSpec() && 0 != bill.getExtraProductSpec()) {
productSpecIds.add(bill.getExtraProductSpec());
}
}
if (productSpecIds.isEmpty())
return productSpecMap;
ExtraProductSpecExample example = new ExtraProductSpecExample();
ExtraProductSpecExample.Criteria criteria = example.or();
criteria.andIdIn(productSpecIds);
productSpecMap = sqlSession.selectMap("com.itrus.portal.db.ExtraProductSpecMapper.selectByExample", example, "id");
return productSpecMap;
}
use of com.itrus.portal.db.ExtraProductSpecExample in project portal by ixinportal.
the class ExtraProductSpecServiceImpl method getSpecByProductId.
/**
* 根据增值产品,获取增值产品对应的规格
*
* @throws Exception
*/
public List<ExtraProductSpec> getSpecByProductId(Long id) throws Exception {
List<ExtraProductSpec> extraProductSpecs = new ArrayList<>();
ExtraProductSpecExample example = new ExtraProductSpecExample();
ExtraProductSpecExample.Criteria criteria = example.or();
criteria.andExtraProductEqualTo(id);
example.setOrderByClause("priority ASC");
extraProductSpecs = selectByExample(example);
return extraProductSpecs;
}
use of com.itrus.portal.db.ExtraProductSpecExample in project portal by ixinportal.
the class ExtraProductSpecServiceImpl method getSpecByProductIdValid.
/**
* 根据增值产品,获取增值产品对应的规格,获取有效的规格,排序
*
* @throws Exception
*/
public List<ExtraProductSpec> getSpecByProductIdValid(Long id) throws Exception {
List<ExtraProductSpec> extraProductSpecs = new ArrayList<>();
ExtraProductSpecExample example = new ExtraProductSpecExample();
ExtraProductSpecExample.Criteria criteria = example.or();
criteria.andExtraProductEqualTo(id);
criteria.andIsValidEqualTo(true);
example.setOrderByClause("priority ASC");
extraProductSpecs = selectByExample(example);
return extraProductSpecs;
}
Aggregations