Search in sources :

Example 6 with ServiceNameExample

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

the class TakeServiceNameServiceImpl method checkValidCertificationCharging.

/**
 * 如果该CertificationCharging下所有的ServiceName都已经无效了.那么就不校验改CertificationCharging
 * 校验该CertificationCharging
 * @param ccList
 * @return
 */
private List<CertificationCharging> checkValidCertificationCharging(List<CertificationCharging> ccList) {
    if (null == ccList || ccList.size() == 0) {
        return ccList;
    }
    Iterator<CertificationCharging> iterator = ccList.iterator();
    while (iterator.hasNext()) {
        CertificationCharging certificationCharging = iterator.next();
        ServiceNameExample serviceNameExample = new ServiceNameExample();
        ServiceNameExample.Criteria criteria = serviceNameExample.or();
        criteria.andCertificationChargingEqualTo(certificationCharging.getId());
        criteria.andIsValidityEqualTo(true);
        List<ServiceName> serviceNames = selectListByExample(serviceNameExample);
        if (null == serviceNames || serviceNames.size() == 0) {
            iterator.remove();
        }
    }
    return ccList;
}
Also used : CertificationCharging(com.itrus.portal.db.CertificationCharging) ServiceName(com.itrus.portal.db.ServiceName) ServiceNameExample(com.itrus.portal.db.ServiceNameExample)

Example 7 with ServiceNameExample

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

the class StoreServiceNameServiceImpl method checkValidCertificationCharging.

/**
 * 如果该CertificationCharging下所有的ServiceName都已经无效了.那么就不校验改CertificationCharging
 * 校验该CertificationCharging
 * @param ccList
 * @return
 */
private List<CertificationCharging> checkValidCertificationCharging(List<CertificationCharging> ccList) {
    if (null == ccList || ccList.size() == 0) {
        return ccList;
    }
    Iterator<CertificationCharging> iterator = ccList.iterator();
    while (iterator.hasNext()) {
        CertificationCharging certificationCharging = iterator.next();
        ServiceNameExample serviceNameExample = new ServiceNameExample();
        ServiceNameExample.Criteria criteria = serviceNameExample.or();
        criteria.andCertificationChargingEqualTo(certificationCharging.getId());
        criteria.andIsValidityEqualTo(true);
        List<ServiceName> serviceNames = selectListByExample(serviceNameExample);
        if (null == serviceNames || serviceNames.size() == 0) {
            iterator.remove();
        }
    }
    return ccList;
}
Also used : CertificationCharging(com.itrus.portal.db.CertificationCharging) ServiceName(com.itrus.portal.db.ServiceName) ServiceNameExample(com.itrus.portal.db.ServiceNameExample)

Example 8 with ServiceNameExample

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

the class StoreServiceNameServiceImpl method getServiceNamesByCertificationCharging.

/**
 * 根据输入的条件,获取serviceNameList
 *
 * @param certificationChargingId
 * @param certificationServiceId
 * @return
 */
public List<ServiceName> getServiceNamesByCertificationCharging(Long certificationChargingId, Long certificationServiceId, boolean isValidity) {
    List<ServiceName> list = new ArrayList<ServiceName>();
    ServiceNameExample serviceNameExample = new ServiceNameExample();
    ServiceNameExample.Criteria criteria = serviceNameExample.or();
    if (null != certificationChargingId) {
        criteria.andCertificationChargingEqualTo(certificationChargingId);
    }
    if (null != certificationServiceId) {
        criteria.andCertificationServiceIdEqualTo(certificationServiceId);
    }
    criteria.andIsValidityEqualTo(isValidity);
    list = sqlSession.selectList("com.itrus.portal.db.ServiceNameMapper.selectByExample", serviceNameExample);
    return list;
}
Also used : ServiceName(com.itrus.portal.db.ServiceName) ServiceNameExample(com.itrus.portal.db.ServiceNameExample) ArrayList(java.util.ArrayList)

Example 9 with ServiceNameExample

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

the class StoreServiceNameServiceImpl method selectListByCertificationChargings.

/**
 * 取出所有属于该计费规则的服务名称
 *
 * @param certificationCharging
 * @return
 */
public List<ServiceName> selectListByCertificationChargings(List<CertificationCharging> certificationChargings) {
    List<Long> ccIdList = new ArrayList<Long>();
    for (int i = 0; i < certificationChargings.size(); i++) {
        ccIdList.add(certificationChargings.get(i).getId());
    }
    List<ServiceName> list = new ArrayList<ServiceName>();
    ServiceNameExample serviceNameExample = new ServiceNameExample();
    ServiceNameExample.Criteria criteria = serviceNameExample.or();
    criteria.andCertificationChargingIn(ccIdList);
    list = sqlSession.selectList("com.itrus.portal.db.ServiceNameMapper.selectByExample", serviceNameExample);
    return list;
}
Also used : ServiceName(com.itrus.portal.db.ServiceName) ServiceNameExample(com.itrus.portal.db.ServiceNameExample) ArrayList(java.util.ArrayList)

Example 10 with ServiceNameExample

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

the class StoreServiceNameServiceImpl method selectListByCertificationChargingId.

public List<ServiceName> selectListByCertificationChargingId(Long CertificationChargingId) {
    List<ServiceName> list = new ArrayList<ServiceName>();
    ServiceNameExample serviceNameExample = new ServiceNameExample();
    ServiceNameExample.Criteria criteria = serviceNameExample.or();
    criteria.andCertificationChargingEqualTo(CertificationChargingId);
    criteria.andIsValidityEqualTo(true);
    list = sqlSession.selectList("com.itrus.portal.db.ServiceNameMapper.selectByExample", serviceNameExample);
    return list;
}
Also used : ServiceName(com.itrus.portal.db.ServiceName) ServiceNameExample(com.itrus.portal.db.ServiceNameExample) ArrayList(java.util.ArrayList)

Aggregations

ServiceName (com.itrus.portal.db.ServiceName)15 ServiceNameExample (com.itrus.portal.db.ServiceNameExample)15 ArrayList (java.util.ArrayList)12 CertificationCharging (com.itrus.portal.db.CertificationCharging)3