Search in sources :

Example 1 with PreferentialRecordExample

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

the class PreferentialRecordServiceImpl method selectPreferentialRecordSByBillId.

public PreferentialRecord selectPreferentialRecordSByBillId(Long billId) {
    PreferentialRecordExample pre = new PreferentialRecordExample();
    PreferentialRecordExample.Criteria criteria = pre.or();
    criteria.andBillEqualTo(billId);
    return sqlSession.selectOne("com.itrus.portal.db.PreferentialRecordMapper.selectByExample", pre);
}
Also used : PreferentialRecordExample(com.itrus.portal.db.PreferentialRecordExample)

Example 2 with PreferentialRecordExample

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

the class PreferentialRecordServiceImpl method selectPreferentialRecordSByBillIdAndProductId.

/**
 * 查询对应订单和产品的优惠购买记录
 * @param billId
 * @return
 */
public PreferentialRecord selectPreferentialRecordSByBillIdAndProductId(Long billId, Long productId) {
    PreferentialRecordExample pre = new PreferentialRecordExample();
    PreferentialRecordExample.Criteria criteria = pre.or();
    criteria.andBillEqualTo(billId);
    criteria.andProductEqualTo(productId);
    return sqlSession.selectOne("com.itrus.portal.db.PreferentialRecordMapper.selectByExample", pre);
}
Also used : PreferentialRecordExample(com.itrus.portal.db.PreferentialRecordExample)

Example 3 with PreferentialRecordExample

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

the class PreferentialRecordServiceImpl method setRecordToInvalid.

/**
 * 根据产品id和规格id,将优惠记录设置为无效
 * @param productId
 * @param productSpecId
 * @throws Exception
 */
public void setRecordToInvalid(Long productId, Long productSpecId) throws Exception {
    PreferentialRecordExample pre = new PreferentialRecordExample();
    PreferentialRecordExample.Criteria criteria = pre.or();
    if (null != productSpecId) {
        criteria.andProductSpecEqualTo(productSpecId);
    }
    criteria.andProductEqualTo(productId);
    List<PreferentialRecord> prList = sqlSession.selectList("com.itrus.portal.db.PreferentialRecordMapper.selectByExample", pre);
    for (PreferentialRecord preferentialRecord : prList) {
        preferentialRecord.setIsValidity(false);
        updatePreferentialRecord(preferentialRecord);
    }
}
Also used : PreferentialRecordExample(com.itrus.portal.db.PreferentialRecordExample) PreferentialRecord(com.itrus.portal.db.PreferentialRecord)

Aggregations

PreferentialRecordExample (com.itrus.portal.db.PreferentialRecordExample)3 PreferentialRecord (com.itrus.portal.db.PreferentialRecord)1