use of com.itrus.portal.db.ProductSpecExample in project portal by ixinportal.
the class ProductSpecServiceImpl method getProductSpecs.
/**
* 获取指定产品的所有规格
*
* @param productId
* 产品id
* @param isValidityTrue
* 是否有效,可选
* @return
* @throws Exception
*/
public List<ProductSpec> getProductSpecs(Long productId, Boolean isValidityTrue) throws Exception {
List<ProductSpec> productSpecList = new ArrayList<ProductSpec>();
ProductSpecExample example = new ProductSpecExample();
ProductSpecExample.Criteria criteria = example.or();
criteria.andProductIdEqualTo(productId);
if (null != isValidityTrue) {
criteria.andIsValidityEqualTo(isValidityTrue);
}
example.setOrderByClause("create_time asc");
productSpecList = sqlSession.selectList("com.itrus.portal.db.ProductSpecMapper.selectByExample", example);
return productSpecList;
}
use of com.itrus.portal.db.ProductSpecExample in project portal by ixinportal.
the class ProductSpecServiceImpl method getEditBillProductSpec.
/**
* 获取填写中订单list对应的规格Map
*
* @param billList
* @return
*/
public Map<Long, ProductSpec> getEditBillProductSpec(List<EditBill> editBillList) {
Map<Long, ProductSpec> productSpecMap = new HashMap<Long, ProductSpec>();
List<Long> productSpecIds = new ArrayList<Long>();
for (EditBill bill : editBillList) {
if (null != bill.getProductSpec() && 0 != bill.getProductSpec()) {
productSpecIds.add(bill.getProductSpec());
}
}
if (productSpecIds.isEmpty())
return productSpecMap;
ProductSpecExample example = new ProductSpecExample();
ProductSpecExample.Criteria criteria = example.or();
criteria.andIdIn(productSpecIds);
productSpecMap = sqlSession.selectMap("com.itrus.portal.db.ProductSpecMapper.selectByExample", example, "id");
return productSpecMap;
}
use of com.itrus.portal.db.ProductSpecExample in project portal by ixinportal.
the class ProductSpecServiceImpl method getProductSpec.
/**
* 获取订单list对应的规格Map
*
* @param billList
* @return
*/
public Map<Long, ProductSpec> getProductSpec(List<Bill> billList) {
Map<Long, ProductSpec> productSpecMap = new HashMap<Long, ProductSpec>();
List<Long> productSpecIds = new ArrayList<Long>();
for (Bill bill : billList) {
if (null != bill.getProductSpec() && 0 != bill.getProductSpec()) {
productSpecIds.add(bill.getProductSpec());
}
if (null != bill.getProductSpec1() && 0 != bill.getProductSpec1()) {
productSpecIds.add(bill.getProductSpec1());
}
if (null != bill.getProductSpec2() && 0 != bill.getProductSpec2()) {
productSpecIds.add(bill.getProductSpec2());
}
if (null != bill.getProductSpec3() && 0 != bill.getProductSpec3()) {
productSpecIds.add(bill.getProductSpec3());
}
}
if (productSpecIds.isEmpty())
return productSpecMap;
ProductSpecExample example = new ProductSpecExample();
ProductSpecExample.Criteria criteria = example.or();
criteria.andIdIn(productSpecIds);
productSpecMap = sqlSession.selectMap("com.itrus.portal.db.ProductSpecMapper.selectByExample", example, "id");
return productSpecMap;
}
Aggregations