Search in sources :

Example 6 with ChargingPriceExample

use of com.itrus.portal.db.ChargingPriceExample in project portal by ixinportal.

the class ChargingPriceServiceImpl method selectListByOneServiceName.

/**
 * 根据serviceName,获取对应的计费以及价格区间
 *
 * @param serviceNames
 * @return
 */
public List<ChargingPrice> selectListByOneServiceName(ServiceName serviceName) {
    List<ChargingPrice> list = new ArrayList<ChargingPrice>();
    ChargingPriceExample chargingPriceExample = new ChargingPriceExample();
    ChargingPriceExample.Criteria criteria = chargingPriceExample.or();
    criteria.andServiceNameEqualTo(serviceName.getId());
    chargingPriceExample.setOrderByClause("minimum_number asc");
    list = sqlSession.selectList("com.itrus.portal.db.ChargingPriceMapper.selectByExample", chargingPriceExample);
    return list;
}
Also used : ChargingPriceExample(com.itrus.portal.db.ChargingPriceExample) ArrayList(java.util.ArrayList) ChargingPrice(com.itrus.portal.db.ChargingPrice)

Example 7 with ChargingPriceExample

use of com.itrus.portal.db.ChargingPriceExample in project portal by ixinportal.

the class ChargingPriceServiceImpl method selectListByServiceName.

/**
 * 获取该服务下的有效的计费价格区间(最大值大于total,按照最小值升序排序)
 *
 * @param serviceName
 * @return
 */
public List<ChargingPrice> selectListByServiceName(ServiceName serviceName) {
    List<ChargingPrice> list = new ArrayList<ChargingPrice>();
    ChargingPriceExample chargingPriceExample = new ChargingPriceExample();
    ChargingPriceExample.Criteria criteria = chargingPriceExample.or();
    criteria.andServiceNameEqualTo(serviceName.getId());
    criteria.andMaximumNumberGreaterThan(serviceName.getTotalNumber());
    chargingPriceExample.setOrderByClause("minimum_number asc");
    list = sqlSession.selectList("com.itrus.portal.db.ChargingPriceMapper.selectByExample", chargingPriceExample);
    return list;
}
Also used : ChargingPriceExample(com.itrus.portal.db.ChargingPriceExample) ArrayList(java.util.ArrayList) ChargingPrice(com.itrus.portal.db.ChargingPrice)

Example 8 with ChargingPriceExample

use of com.itrus.portal.db.ChargingPriceExample in project portal by ixinportal.

the class ChargingPriceServiceImpl method selectList.

public List<ChargingPrice> selectList() {
    List<ChargingPrice> list = new ArrayList<ChargingPrice>();
    ChargingPriceExample chargingPriceExample = new ChargingPriceExample();
    ChargingPriceExample.Criteria criteria = chargingPriceExample.or();
    list = sqlSession.selectList("com.itrus.portal.db.ChargingPriceMapper.selectByExample", chargingPriceExample);
    return list;
}
Also used : ChargingPriceExample(com.itrus.portal.db.ChargingPriceExample) ArrayList(java.util.ArrayList) ChargingPrice(com.itrus.portal.db.ChargingPrice)

Example 9 with ChargingPriceExample

use of com.itrus.portal.db.ChargingPriceExample in project portal by ixinportal.

the class ChargingPriceServiceImpl method selectChargingPriceList.

/**
 * 获取该serviceName下属的所有计费规则,按照最大值降序排序
 * @param serviceName
 * @return
 */
public List<ChargingPrice> selectChargingPriceList(ServiceName serviceName) {
    ChargingPriceExample cpe = new ChargingPriceExample();
    ChargingPriceExample.Criteria criteria = cpe.or();
    criteria.andCertificationChargingEqualTo(serviceName.getCertificationCharging());
    criteria.andServiceNameEqualTo(serviceName.getId());
    cpe.setOrderByClause("maximum_number desc");
    List<ChargingPrice> list = sqlSession.selectList("com.itrus.portal.db.ChargingPriceMapper.selectByExample", cpe);
    return list;
}
Also used : ChargingPriceExample(com.itrus.portal.db.ChargingPriceExample) ChargingPrice(com.itrus.portal.db.ChargingPrice)

Example 10 with ChargingPriceExample

use of com.itrus.portal.db.ChargingPriceExample in project portal by ixinportal.

the class ChargingPriceServiceImpl method selectListByServiceNames.

/**
 * 根据serviceName,获取对应的计费以及价格区间
 *
 * @param serviceNames
 * @return
 */
public List<ChargingPrice> selectListByServiceNames(List<ServiceName> serviceNames) {
    List<Long> serviceNamesId = new ArrayList<Long>();
    for (int i = 0; i < serviceNames.size(); i++) {
        serviceNamesId.add(serviceNames.get(i).getId());
    }
    List<ChargingPrice> list = new ArrayList<ChargingPrice>();
    ChargingPriceExample chargingPriceExample = new ChargingPriceExample();
    ChargingPriceExample.Criteria criteria = chargingPriceExample.or();
    criteria.andServiceNameIn(serviceNamesId);
    list = sqlSession.selectList("com.itrus.portal.db.ChargingPriceMapper.selectByExample", chargingPriceExample);
    return list;
}
Also used : ChargingPriceExample(com.itrus.portal.db.ChargingPriceExample) ArrayList(java.util.ArrayList) ChargingPrice(com.itrus.portal.db.ChargingPrice)

Aggregations

ChargingPrice (com.itrus.portal.db.ChargingPrice)15 ChargingPriceExample (com.itrus.portal.db.ChargingPriceExample)15 ArrayList (java.util.ArrayList)12