use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getRenewProduct.
/**
* 查询证书所属的产品
*
* @param raId
* @param projectId
* @param type
* 业务类型(更新、初购)
* @return
*/
public Product getRenewProduct(Long raId, Long projectId, String type, String certDn) {
List<Product> productList = new ArrayList<Product>();
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andRaEqualTo(raId);
if (null != projectId)
criteria.andProjectEqualTo(projectId);
if (StringUtils.isNotBlank(type))
criteria.andTypeEqualTo(type);
example.setOrderByClause("create_time desc");
productList = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
return getProductByCertUid(productList, certDn);
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getProductByRa.
/**
* 查询配置了某个ra的最新产品
*
* @param raId
* @return
*/
public Product getProductByRa(Long raId) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andRaEqualTo(raId);
example.setOrderByClause("create_time desc");
example.setLimit(1);
Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", example);
return product;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getProductByOldProductId.
/**
* 根据产品id,获取该产品对应的更新产品
*
* @param oldProductId
* @return
*/
public Product getProductByOldProductId(Long oldProductId, String type) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andOldProNameEqualTo(oldProductId);
criteria.andTypeEqualTo(type);
example.setOrderByClause("create_time desc");
example.setLimit(1);
Product product = sqlSession.selectOne("com.itrus.portal.db.ProductMapper.selectByExample", example);
return product;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getProductIdsByCertification.
/**
* 根据认证等级查询产品id
*
* @param certificationIds
* @return
*/
public List<Long> getProductIdsByCertification(List<Long> certificationIds) {
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andAuthenticationIn(certificationIds);
List<Long> productIds = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectProductIdsByLevel", example);
return productIds;
}
use of com.itrus.portal.db.ProductExample in project portal by ixinportal.
the class ProductServiceImpl method getKeyUnlockProducts.
/**
* 获取该项目下所有的未下架的解锁产品
* @param projectId
* @return
*/
public List<Product> getKeyUnlockProducts(Long projectId, Long userinfoId) {
if (null == projectId) {
return null;
}
List<Product> products = new ArrayList<>();
ProductExample example = new ProductExample();
ProductExample.Criteria criteria = example.or();
criteria.andProjectEqualTo(projectId);
criteria.andIsBanEqualTo(false);
criteria.andKeyUnlockTypeIsNotNull();
// 若证书没有绑定用户,则不返回自助解锁的产品
if (null == userinfoId) {
criteria.andKeyUnlockTypeNotEqualTo(1);
}
products = sqlSession.selectList("com.itrus.portal.db.ProductMapper.selectByExample", example);
return products;
}
Aggregations