Java Code Examples for com.macro.mall.model.PmsBrand#setFirstLetter()
The following examples show how to use
com.macro.mall.model.PmsBrand#setFirstLetter() .
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: PmsBrandServiceImpl.java From mall-swarm with Apache License 2.0 | 6 votes |
@Override public int updateBrand(Long id, PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); pmsBrand.setId(id); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } //更新品牌时要更新商品中的品牌名称 PmsProduct product = new PmsProduct(); product.setBrandName(pmsBrand.getName()); PmsProductExample example = new PmsProductExample(); example.createCriteria().andBrandIdEqualTo(id); productMapper.updateByExampleSelective(product,example); return brandMapper.updateByPrimaryKeySelective(pmsBrand); }
Example 2
Source File: PmsBrandServiceImpl.java From macrozheng with Apache License 2.0 | 6 votes |
@Override public int updateBrand(Long id, PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); pmsBrand.setId(id); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } //更新品牌时要更新商品中的品牌名称 PmsProduct product = new PmsProduct(); product.setBrandName(pmsBrand.getName()); PmsProductExample example = new PmsProductExample(); example.createCriteria().andBrandIdEqualTo(id); productMapper.updateByExampleSelective(product,example); return brandMapper.updateByPrimaryKeySelective(pmsBrand); }
Example 3
Source File: PmsBrandServiceImpl.java From mall with Apache License 2.0 | 6 votes |
@Override public int updateBrand(Long id, PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); pmsBrand.setId(id); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } //更新品牌时要更新商品中的品牌名称 PmsProduct product = new PmsProduct(); product.setBrandName(pmsBrand.getName()); PmsProductExample example = new PmsProductExample(); example.createCriteria().andBrandIdEqualTo(id); productMapper.updateByExampleSelective(product,example); return brandMapper.updateByPrimaryKeySelective(pmsBrand); }
Example 4
Source File: PmsBrandServiceImpl.java From macrozheng-mall with MIT License | 6 votes |
@Override public int updateBrand(Long id, PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); pmsBrand.setId(id); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } //更新品牌时要更新商品中的品牌名称 PmsProduct product = new PmsProduct(); product.setBrandName(pmsBrand.getName()); PmsProductExample example = new PmsProductExample(); example.createCriteria().andBrandIdEqualTo(id); productMapper.updateByExampleSelective(product,example); return brandMapper.updateByPrimaryKeySelective(pmsBrand); }
Example 5
Source File: PmsBrandServiceImpl.java From mall-swarm with Apache License 2.0 | 5 votes |
@Override public int createBrand(PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } return brandMapper.insertSelective(pmsBrand); }
Example 6
Source File: PmsBrandServiceImpl.java From macrozheng with Apache License 2.0 | 5 votes |
@Override public int createBrand(PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } return brandMapper.insertSelective(pmsBrand); }
Example 7
Source File: PmsBrandServiceImpl.java From mall with Apache License 2.0 | 5 votes |
@Override public int createBrand(PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } return brandMapper.insertSelective(pmsBrand); }
Example 8
Source File: PmsBrandServiceImpl.java From macrozheng-mall with MIT License | 5 votes |
@Override public int createBrand(PmsBrandParam pmsBrandParam) { PmsBrand pmsBrand = new PmsBrand(); BeanUtils.copyProperties(pmsBrandParam, pmsBrand); //如果创建时首字母为空,取名称的第一个为首字母 if (StringUtils.isEmpty(pmsBrand.getFirstLetter())) { pmsBrand.setFirstLetter(pmsBrand.getName().substring(0, 1)); } return brandMapper.insertSelective(pmsBrand); }