com.macro.mall.model.SmsHomeNewProduct Java Examples

The following examples show how to use com.macro.mall.model.SmsHomeNewProduct. 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: SmsHomeNewProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
    PageHelper.startPage(pageNum,pageSize);
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    SmsHomeNewProductExample.Criteria criteria = example.createCriteria();
    if(!StringUtils.isEmpty(productName)){
        criteria.andProductNameLike("%"+productName+"%");
    }
    if(recommendStatus!=null){
        criteria.andRecommendStatusEqualTo(recommendStatus);
    }
    example.setOrderByClause("sort desc");
    return homeNewProductMapper.selectByExample(example);
}
 
Example #2
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct> homeBrandList) {
    int count = homeNewProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #3
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct>> 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<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #4
Source File: SmsHomeNewProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeNewProduct homeNewProduct = new SmsHomeNewProduct();
    homeNewProduct.setId(id);
    homeNewProduct.setSort(sort);
    return homeNewProductMapper.updateByPrimaryKeySelective(homeNewProduct);
}
 
Example #5
Source File: SmsHomeNewProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    example.createCriteria().andIdIn(ids);
    SmsHomeNewProduct record = new SmsHomeNewProduct();
    record.setRecommendStatus(recommendStatus);
    return homeNewProductMapper.updateByExampleSelective(record,example);
}
 
Example #6
Source File: SmsHomeNewProductServiceImpl.java    From mall with Apache License 2.0 5 votes vote down vote up
@Override
public List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
    PageHelper.startPage(pageNum,pageSize);
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    SmsHomeNewProductExample.Criteria criteria = example.createCriteria();
    if(!StringUtils.isEmpty(productName)){
        criteria.andProductNameLike("%"+productName+"%");
    }
    if(recommendStatus!=null){
        criteria.andRecommendStatusEqualTo(recommendStatus);
    }
    example.setOrderByClause("sort desc");
    return homeNewProductMapper.selectByExample(example);
}
 
Example #7
Source File: SmsHomeNewProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
    PageHelper.startPage(pageNum,pageSize);
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    SmsHomeNewProductExample.Criteria criteria = example.createCriteria();
    if(!StringUtils.isEmpty(productName)){
        criteria.andProductNameLike("%"+productName+"%");
    }
    if(recommendStatus!=null){
        criteria.andRecommendStatusEqualTo(recommendStatus);
    }
    example.setOrderByClause("sort desc");
    return homeNewProductMapper.selectByExample(example);
}
 
Example #8
Source File: SmsHomeNewProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    example.createCriteria().andIdIn(ids);
    SmsHomeNewProduct record = new SmsHomeNewProduct();
    record.setRecommendStatus(recommendStatus);
    return homeNewProductMapper.updateByExampleSelective(record,example);
}
 
Example #9
Source File: SmsHomeNewProductServiceImpl.java    From macrozheng with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeNewProduct homeNewProduct = new SmsHomeNewProduct();
    homeNewProduct.setId(id);
    homeNewProduct.setSort(sort);
    return homeNewProductMapper.updateByPrimaryKeySelective(homeNewProduct);
}
 
Example #10
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct>> 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<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #11
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct> homeBrandList) {
    int count = homeNewProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #12
Source File: SmsHomeNewProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum) {
    PageHelper.startPage(pageNum,pageSize);
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    SmsHomeNewProductExample.Criteria criteria = example.createCriteria();
    if(!StringUtils.isEmpty(productName)){
        criteria.andProductNameLike("%"+productName+"%");
    }
    if(recommendStatus!=null){
        criteria.andRecommendStatusEqualTo(recommendStatus);
    }
    example.setOrderByClause("sort desc");
    return homeNewProductMapper.selectByExample(example);
}
 
Example #13
Source File: SmsHomeNewProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    example.createCriteria().andIdIn(ids);
    SmsHomeNewProduct record = new SmsHomeNewProduct();
    record.setRecommendStatus(recommendStatus);
    return homeNewProductMapper.updateByExampleSelective(record,example);
}
 
Example #14
Source File: SmsHomeNewProductServiceImpl.java    From mall-swarm with Apache License 2.0 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeNewProduct homeNewProduct = new SmsHomeNewProduct();
    homeNewProduct.setId(id);
    homeNewProduct.setSort(sort);
    return homeNewProductMapper.updateByPrimaryKeySelective(homeNewProduct);
}
 
Example #15
Source File: SmsHomeNewProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int updateRecommendStatus(List<Long> ids, Integer recommendStatus) {
    SmsHomeNewProductExample example = new SmsHomeNewProductExample();
    example.createCriteria().andIdIn(ids);
    SmsHomeNewProduct record = new SmsHomeNewProduct();
    record.setRecommendStatus(recommendStatus);
    return homeNewProductMapper.updateByExampleSelective(record,example);
}
 
Example #16
Source File: SmsHomeNewProductServiceImpl.java    From macrozheng-mall with MIT License 5 votes vote down vote up
@Override
public int updateSort(Long id, Integer sort) {
    SmsHomeNewProduct homeNewProduct = new SmsHomeNewProduct();
    homeNewProduct.setId(id);
    homeNewProduct.setSort(sort);
    return homeNewProductMapper.updateByPrimaryKeySelective(homeNewProduct);
}
 
Example #17
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName,recommendStatus,pageSize,pageNum);
    return new CommonResult().pageSuccess(homeBrandList);
}
 
Example #18
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct> homeBrandList) {
    int count = homeNewProductService.create(homeBrandList);
    if(count>0){
        return new CommonResult().success(count);
    }
    return new CommonResult().failed();
}
 
Example #19
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct> homeBrandList) {
    int count = homeNewProductService.create(homeBrandList);
    if (count > 0) {
        return CommonResult.success(count);
    }
    return CommonResult.failed();
}
 
Example #20
Source File: SmsHomeNewProductController.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<SmsHomeNewProduct>> 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<SmsHomeNewProduct> homeBrandList = homeNewProductService.list(productName, recommendStatus, pageSize, pageNum);
    return CommonResult.success(CommonPage.restPage(homeBrandList));
}
 
Example #21
Source File: SmsHomeNewProductService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #22
Source File: SmsHomeNewProductService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeNewProduct> homeNewProductList);
 
Example #23
Source File: SmsHomeNewProductService.java    From mall with Apache License 2.0 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #24
Source File: SmsHomeNewProductService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #25
Source File: SmsHomeNewProductService.java    From macrozheng-mall with MIT License 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeNewProduct> homeNewProductList);
 
Example #26
Source File: SmsHomeNewProductService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 分页查询推荐
 */
List<SmsHomeNewProduct> list(String productName, Integer recommendStatus, Integer pageSize, Integer pageNum);
 
Example #27
Source File: SmsHomeNewProductService.java    From macrozheng with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeNewProduct> homeNewProductList);
 
Example #28
Source File: SmsHomeNewProductService.java    From mall-swarm with Apache License 2.0 2 votes vote down vote up
/**
 * 添加首页推荐
 */
@Transactional
int create(List<SmsHomeNewProduct> homeNewProductList);
 
Example #29
Source File: SmsHomeNewProductMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int insert(SmsHomeNewProduct record); 
Example #30
Source File: SmsHomeNewProductMapper.java    From macrozheng-mall with MIT License votes vote down vote up
int insertSelective(SmsHomeNewProduct record);