Search in sources :

Example 1 with MobileChargingPriceExample

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

the class MobileChargingPriceService method selectListByServiceName.

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

Example 2 with MobileChargingPriceExample

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

the class MobileChargingPriceService method selectListByOneAppserviceName.

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

Example 3 with MobileChargingPriceExample

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

the class MobileChargingPriceService method selectChargingPriceList.

/**
 * 获取该appserviceName下属的所有计费规则,按照最大值降序排序
 * @param appserviceName
 * @return
 */
public List<MobileChargingPrice> selectChargingPriceList(MobileAppserviceName appserviceName) {
    MobileChargingPriceExample mcpe = new MobileChargingPriceExample();
    MobileChargingPriceExample.Criteria criteria = mcpe.or();
    criteria.andAppserviceChargingEqualTo(appserviceName.getAppserviceCharging());
    criteria.andAppserviceNameEqualTo(appserviceName.getId());
    mcpe.setOrderByClause("maximum_number desc");
    List<MobileChargingPrice> list = sqlSession.selectList("com.itrus.portal.db.MobileChargingPriceMapper.selectByExample", mcpe);
    return list;
}
Also used : MobileChargingPrice(com.itrus.portal.db.MobileChargingPrice) MobileChargingPriceExample(com.itrus.portal.db.MobileChargingPriceExample)

Aggregations

MobileChargingPrice (com.itrus.portal.db.MobileChargingPrice)3 MobileChargingPriceExample (com.itrus.portal.db.MobileChargingPriceExample)3 ArrayList (java.util.ArrayList)2