@Override public int delete(List<Long> ids) { SmsHomeRecommendProductExample example = new SmsHomeRecommendProductExample(); example.createCriteria().andIdIn(ids); return recommendProductMapper.deleteByExample(example); }
@Override public List<SmsHomeRecommendProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) { PageHelper.startPage(pageNum,pageSize); SmsHomeRecommendProductExample example = new SmsHomeRecommendProductExample(); SmsHomeRecommendProductExample.Criteria criteria = example.createCriteria(); if(!StringUtils.isEmpty(productName)){ criteria.andProductNameLike("%"+productName+"%"); } if(recommendStatus!=null){ criteria.andRecommendStatusEqualTo(recommendStatus); } example.setOrderByClause("sort desc"); return recommendProductMapper.selectByExample(example); } }
@Override public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) { SmsHomeRecommendProductExample example = new SmsHomeRecommendProductExample(); example.createCriteria().andIdIn(ids); SmsHomeRecommendProduct record = new SmsHomeRecommendProduct(); record.setRecommendStatus(recommendStatus); return recommendProductMapper.updateByExampleSelective(record,example); }