com.macro.mall.model.SmsHomeRecommendProduct Java Examples

The following examples show how to use com.macro.mall.model.SmsHomeRecommendProduct. 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: SmsHomeRecommendProductController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("添加首页推荐")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
    int count = recommendProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #2
Source File: SmsHomeRecommendProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int create(List<SmsHomeRecommendProduct> homeRecommendProductList) {
    for (SmsHomeRecommendProduct recommendProduct : homeRecommendProductList) {
        recommendProduct.setRecommendStatus(1);
        recommendProduct.setSort(0);
        recommendProductMapper.insert(recommendProduct);
    }
    return homeRecommendProductList.size();
}
 
Example #3
Source File: SmsHomeRecommendProductController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public Object list(@RequestParam(value = "productName", required = false) String productName,
                   @RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
                   @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                   @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
    List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName,recommendStatus,pageSize,pageNum);
    return new CommonResult().pageSuccess(homeBrandList);
}
 
Example #4
Source File: SmsHomeRecommendProductController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("添加首页推荐")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
    int count = recommendProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #5
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int create(List<SmsHomeRecommendProduct> homeRecommendProductList) {
    for (SmsHomeRecommendProduct recommendProduct : homeRecommendProductList) {
        recommendProduct.setRecommendStatus(1);
        recommendProduct.setSort(0);
        recommendProductMapper.insert(recommendProduct);
    }
    return homeRecommendProductList.size();
}
 
Example #6
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeRecommendProduct recommendProduct = new SmsHomeRecommendProduct();
    recommendProduct.setId(id);
    recommendProduct.setSort(sort);
    return recommendProductMapper.updateByPrimaryKeySelective(recommendProduct);
}
 
Example #7
Source File: SmsHomeRecommendProductController.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeRecommendProduct>> list(@RequestParam(value = "productName", required = false) String productName,
                                                              @RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
                                                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
    List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #8
Source File: SmsHomeRecommendProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #9
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@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);
}
 
Example #10
Source File: SmsHomeRecommendProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeRecommendProduct recommendProduct = new SmsHomeRecommendProduct();
    recommendProduct.setId(id);
    recommendProduct.setSort(sort);
    return recommendProductMapper.updateByPrimaryKeySelective(recommendProduct);
}
 
Example #11
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@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);
}
 
Example #12
Source File: SmsHomeRecommendProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #13
Source File: SmsHomeRecommendProductController.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@ApiOperation("添加首页推荐")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public Object create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
    int count = recommendProductService.create(homeBrandList);
    if(count>0){
        return new CommonResult().success(count);
    }
    return new CommonResult().failed();
}
 
Example #14
Source File: SmsHomeRecommendProductController.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeRecommendProduct>> list(@RequestParam(value = "productName", required = false) String productName,
                                                              @RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
                                                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
    List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #15
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int create(List<SmsHomeRecommendProduct> homeRecommendProductList) {
    for (SmsHomeRecommendProduct recommendProduct : homeRecommendProductList) {
        recommendProduct.setRecommendStatus(1);
        recommendProduct.setSort(0);
        recommendProductMapper.insert(recommendProduct);
    }
    return homeRecommendProductList.size();
}
 
Example #16
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeRecommendProduct recommendProduct = new SmsHomeRecommendProduct();
    recommendProduct.setId(id);
    recommendProduct.setSort(sort);
    return recommendProductMapper.updateByPrimaryKeySelective(recommendProduct);
}
 
Example #17
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #18
Source File: SmsHomeRecommendProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #19
Source File: SmsHomeRecommendProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #20
Source File: SmsHomeRecommendProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@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);
}
 
Example #21
Source File: SmsHomeRecommendProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeRecommendProduct recommendProduct = new SmsHomeRecommendProduct();
    recommendProduct.setId(id);
    recommendProduct.setSort(sort);
    return recommendProductMapper.updateByPrimaryKeySelective(recommendProduct);
}
 
Example #22
Source File: SmsHomeRecommendProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int create(List<SmsHomeRecommendProduct> homeRecommendProductList) {
    for (SmsHomeRecommendProduct recommendProduct : homeRecommendProductList) {
        recommendProduct.setRecommendStatus(1);
        recommendProduct.setSort(0);
        recommendProductMapper.insert(recommendProduct);
    }
    return homeRecommendProductList.size();
}
 
Example #23
Source File: SmsHomeRecommendProductController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("分页查询推荐")
@RequestMapping(value = "/list", method = RequestMethod.GET)
@ResponseBody
public CommonResult<CommonPage<SmsHomeRecommendProduct>> list(@RequestParam(value = "productName", required = false) String productName,
                                                              @RequestParam(value = "recommendStatus", required = false) Integer recommendStatus,
                                                              @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize,
                                                              @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum) {
    List<SmsHomeRecommendProduct> homeBrandList = recommendProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #24
Source File: SmsHomeRecommendProductController.java    From mall with Apache License 2.0 5 votes vote down vote up
@ApiOperation("添加首页推荐")
@RequestMapping(value = "/create", method = RequestMethod.POST)
@ResponseBody
public CommonResult create(@RequestBody List<SmsHomeRecommendProduct> homeBrandList) {
    int count = recommendProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #25
Source File: SmsHomeRecommendProductService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeRecommendProduct> homeRecommendProductList);
 
Example #26
Source File: SmsHomeRecommendProductService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeRecommendProduct> homeRecommendProductList);
 
Example #27
Source File: SmsHomeRecommendProductService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeRecommendProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #28
Source File: SmsHomeRecommendProductService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeRecommendProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #29
Source File: SmsHomeRecommendProductService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeRecommendProduct> homeRecommendProductList);
 
Example #30
Source File: SmsHomeRecommendProductService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeRecommendProduct> homeRecommendProductList);