com.macro.mall.model.OmsCartItemExample Java Examples

The following examples show how to use com.macro.mall.model.OmsCartItemExample. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 6 votes vote down vote up
/**
 * 根据会员id,商品id和规格获取购物车中商品
 */
private OmsCartItem getCartItem(OmsCartItem cartItem) {
    OmsCartItemExample example = new OmsCartItemExample();
    OmsCartItemExample.Criteria criteria = example.createCriteria().andMemberIdEqualTo(cartItem.getMemberId())
            .andProductIdEqualTo(cartItem.getProductId()).andDeleteStatusEqualTo(0);
    if (!StringUtils.isEmpty(cartItem.getSp1())) {
        criteria.andSp1EqualTo(cartItem.getSp1());
    }
    if (!StringUtils.isEmpty(cartItem.getSp2())) {
        criteria.andSp2EqualTo(cartItem.getSp2());
    }
    if (!StringUtils.isEmpty(cartItem.getSp3())) {
        criteria.andSp3EqualTo(cartItem.getSp3());
    }
    List<OmsCartItem> cartItemList = cartItemMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(cartItemList)) {
        return cartItemList.get(0);
    }
    return null;
}
 
Example #2
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 6 votes vote down vote up
/**
 * 根据会员id,商品id和规格获取购物车中商品
 */
private OmsCartItem getCartItem(OmsCartItem cartItem) {
    OmsCartItemExample example = new OmsCartItemExample();
    OmsCartItemExample.Criteria criteria = example.createCriteria().andMemberIdEqualTo(cartItem.getMemberId())
            .andProductIdEqualTo(cartItem.getProductId()).andDeleteStatusEqualTo(0);
    if (!StringUtils.isEmpty(cartItem.getSp1())) {
        criteria.andSp1EqualTo(cartItem.getSp1());
    }
    if (!StringUtils.isEmpty(cartItem.getSp2())) {
        criteria.andSp2EqualTo(cartItem.getSp2());
    }
    if (!StringUtils.isEmpty(cartItem.getSp3())) {
        criteria.andSp3EqualTo(cartItem.getSp3());
    }
    List<OmsCartItem> cartItemList = cartItemMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(cartItemList)) {
        return cartItemList.get(0);
    }
    return null;
}
 
Example #3
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example #4
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
/**
 * 根据会员id,商品id和规格获取购物车中商品
 */
private OmsCartItem getCartItem(OmsCartItem cartItem) {
    OmsCartItemExample example = new OmsCartItemExample();
    OmsCartItemExample.Criteria criteria = example.createCriteria().andMemberIdEqualTo(cartItem.getMemberId())
            .andProductIdEqualTo(cartItem.getProductId()).andDeleteStatusEqualTo(0);
    if (!StringUtils.isEmpty(cartItem.getProductSkuId())) {
        criteria.andProductSkuIdEqualTo(cartItem.getProductSkuId());
    }
    List<OmsCartItem> cartItemList = cartItemMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(cartItemList)) {
        return cartItemList.get(0);
    }
    return null;
}
 
Example #5
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int updateQuantity(Long id, Long memberId, Integer quantity) {
    OmsCartItem cartItem = new OmsCartItem();
    cartItem.setQuantity(quantity);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0)
            .andIdEqualTo(id).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(cartItem, example);
}
 
Example #6
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example #7
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example #8
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example #9
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example #10
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int updateQuantity(Long id, Long memberId, Integer quantity) {
    OmsCartItem cartItem = new OmsCartItem();
    cartItem.setQuantity(quantity);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0)
            .andIdEqualTo(id).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(cartItem, example);
}
 
Example #11
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int clear(Long memberId) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record,example);
}
 
Example #12
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example #13
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int updateQuantity(Long id, Long memberId, Integer quantity) {
    OmsCartItem cartItem = new OmsCartItem();
    cartItem.setQuantity(quantity);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0)
            .andIdEqualTo(id).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(cartItem, example);
}
 
Example #14
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
/**
 * 根据会员id,商品id和规格获取购物车中商品
 */
private OmsCartItem getCartItem(OmsCartItem cartItem) {
    OmsCartItemExample example = new OmsCartItemExample();
    OmsCartItemExample.Criteria criteria = example.createCriteria().andMemberIdEqualTo(cartItem.getMemberId())
            .andProductIdEqualTo(cartItem.getProductId()).andDeleteStatusEqualTo(0);
    if (!StringUtils.isEmpty(cartItem.getProductSkuId())) {
        criteria.andProductSkuIdEqualTo(cartItem.getProductSkuId());
    }
    List<OmsCartItem> cartItemList = cartItemMapper.selectByExample(example);
    if (!CollectionUtils.isEmpty(cartItemList)) {
        return cartItemList.get(0);
    }
    return null;
}
 
Example #15
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int updateQuantity(Long id, Long memberId, Integer quantity) {
    OmsCartItem cartItem = new OmsCartItem();
    cartItem.setQuantity(quantity);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0)
            .andIdEqualTo(id).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(cartItem, example);
}
 
Example #16
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int delete(Long memberId, List<Long> ids) {
    OmsCartItem record = new OmsCartItem();
    record.setDeleteStatus(1);
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andIdIn(ids).andMemberIdEqualTo(memberId);
    return cartItemMapper.updateByExampleSelective(record, example);
}
 
Example #17
Source File: OmsCartItemServiceImpl.java    From macrozheng with Apache License 2.0 4 votes vote down vote up
@Override
public List<OmsCartItem> list(Long memberId) {
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0).andMemberIdEqualTo(memberId);
    return cartItemMapper.selectByExample(example);
}
 
Example #18
Source File: OmsCartItemServiceImpl.java    From mall-swarm with Apache License 2.0 4 votes vote down vote up
@Override
public List<OmsCartItem> list(Long memberId) {
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0).andMemberIdEqualTo(memberId);
    return cartItemMapper.selectByExample(example);
}
 
Example #19
Source File: OmsCartItemServiceImpl.java    From macrozheng-mall with MIT License 4 votes vote down vote up
@Override
public List<OmsCartItem> list(Long memberId) {
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0).andMemberIdEqualTo(memberId);
    return cartItemMapper.selectByExample(example);
}
 
Example #20
Source File: OmsCartItemServiceImpl.java    From mall with Apache License 2.0 4 votes vote down vote up
@Override
public List<OmsCartItem> list(Long memberId) {
    OmsCartItemExample example = new OmsCartItemExample();
    example.createCriteria().andDeleteStatusEqualTo(0).andMemberIdEqualTo(memberId);
    return cartItemMapper.selectByExample(example);
}
 
Example #21
Source File: OmsCartItemMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByExample(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 
Example #22
Source File: OmsCartItemMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int updateByExampleSelective(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 
Example #23
Source File: OmsCartItemMapper.java    From macrozheng-mall with MIT License votes vote down vote up
List<OmsCartItem> selectByExample(OmsCartItemExample example); 
Example #24
Source File: OmsCartItemMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int deleteByExample(OmsCartItemExample example); 
Example #25
Source File: OmsCartItemMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int countByExample(OmsCartItemExample example); 
Example #26
Source File: OmsCartItemMapper.java    From mall with Apache License 2.0 votes vote down vote up
long countByExample(OmsCartItemExample example); 
Example #27
Source File: OmsCartItemMapper.java    From mall with Apache License 2.0 votes vote down vote up
int updateByExample(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 
Example #28
Source File: OmsCartItemMapper.java    From mall with Apache License 2.0 votes vote down vote up
int updateByExampleSelective(@Param("record") OmsCartItem record, @Param("example") OmsCartItemExample example); 
Example #29
Source File: OmsCartItemMapper.java    From mall with Apache License 2.0 votes vote down vote up
List<OmsCartItem> selectByExample(OmsCartItemExample example); 
Example #30
Source File: OmsCartItemMapper.java    From mall with Apache License 2.0 votes vote down vote up
int deleteByExample(OmsCartItemExample example);