Search in sources :

Example 11 with ChargingPriceExample

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

the class TakeChargingPriceServiceImpl 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 12 with ChargingPriceExample

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

the class TakeChargingPriceServiceImpl 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)

Example 13 with ChargingPriceExample

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

the class TakeChargingPriceServiceImpl 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 14 with ChargingPriceExample

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

the class TakeChargingPriceServiceImpl 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 15 with ChargingPriceExample

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

the class StoreChargingPriceServiceImpl 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)

Aggregations

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