From 313e0cded09c66b8915a011bc841eb138562c17e Mon Sep 17 00:00:00 2001 From: zhh Date: Fri, 16 Nov 2018 14:51:50 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=90=E6=97=B6=E8=B4=AD=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- document/pdm/mall.pdm | 5 +- .../SmsFlashPromotionController.java | 85 +++++++++++++++++++ ...ashPromotionProductRelationController.java | 76 +++++++++++++++++ .../SmsFlashPromotionSessionController.java | 83 ++++++++++++++++++ .../SmsFlashPromotionProductRelationDao.java | 17 ++++ .../mall/dto/SmsFlashPromotionProduct.java | 16 ++++ ...sFlashPromotionProductRelationService.java | 42 +++++++++ .../service/SmsFlashPromotionService.java | 41 +++++++++ .../SmsFlashPromotionSessionService.java | 41 +++++++++ ...shPromotionProductRelationServiceImpl.java | 53 ++++++++++++ .../impl/SmsFlashPromotionServiceImpl.java | 63 ++++++++++++++ .../SmsFlashPromotionSessionServiceImpl.java | 60 +++++++++++++ .../SmsFlashPromotionProductRelationDao.xml | 26 ++++++ 13 files changed, 606 insertions(+), 2 deletions(-) create mode 100644 mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionController.java create mode 100644 mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionProductRelationController.java create mode 100644 mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionSessionController.java create mode 100644 mall-admin/src/main/java/com/macro/mall/dao/SmsFlashPromotionProductRelationDao.java create mode 100644 mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionProduct.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionProductRelationService.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionService.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionSessionService.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionProductRelationServiceImpl.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionServiceImpl.java create mode 100644 mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionSessionServiceImpl.java create mode 100644 mall-admin/src/main/resources/dao/SmsFlashPromotionProductRelationDao.xml diff --git a/document/pdm/mall.pdm b/document/pdm/mall.pdm index a356258..90ffb39 100644 --- a/document/pdm/mall.pdm +++ b/document/pdm/mall.pdm @@ -1,5 +1,5 @@ - + @@ -17071,10 +17071,11 @@ LABL 0 新宋体,8,N id 1542179066 zhenghong -1542179149 +1542349350 zhenghong 编号 bigint +1 1 diff --git a/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionController.java b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionController.java new file mode 100644 index 0000000..192175b --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionController.java @@ -0,0 +1,85 @@ +package com.macro.mall.controller; + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.model.SmsFlashPromotion; +import com.macro.mall.service.SmsFlashPromotionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 限时购活动管理Controller + * Created by macro on 2018/11/16. + */ +@Controller +@Api(tags = "SmsFlashPromotionController",description = "限时购活动管理") +@RequestMapping("/flash") +public class SmsFlashPromotionController { + @Autowired + private SmsFlashPromotionService flashPromotionService; + @ApiOperation("添加活动") + @RequestMapping(value = "/create",method = RequestMethod.POST) + @ResponseBody + public Object create(@RequestBody SmsFlashPromotion flashPromotion){ + int count = flashPromotionService.create(flashPromotion); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("编辑活动信息") + @RequestMapping(value = "/update/{id}",method = RequestMethod.POST) + @ResponseBody + public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotion flashPromotion){ + int count = flashPromotionService.update(id,flashPromotion); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("删除活动信息") + @RequestMapping(value = "/delete/{id}",method = RequestMethod.POST) + @ResponseBody + public Object delete(@PathVariable Long id){ + int count = flashPromotionService.delete(id); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("修改上下线状态") + @RequestMapping(value = "/update/status/{id}",method = RequestMethod.POST) + @ResponseBody + public Object update(@PathVariable Long id,Integer status){ + int count = flashPromotionService.updateStatus(id,status); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("获取活动详情") + @RequestMapping(value = "/{id}",method = RequestMethod.GET) + @ResponseBody + public Object getItem(@PathVariable Long id){ + SmsFlashPromotion flashPromotion = flashPromotionService.getItem(id); + return new CommonResult().success(flashPromotion); + } + + @ApiOperation("根据活动名称分页查询") + @RequestMapping(value = "/list",method = RequestMethod.GET) + @ResponseBody + public Object getItem(@RequestParam(value = "keyword",required = false)String keyword, + @RequestParam(value = "pageSize",defaultValue = "5")Integer pageSize, + @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum){ + List flashPromotionList = flashPromotionService.list(keyword,pageSize,pageNum); + return new CommonResult().pageSuccess(flashPromotionList); + } +} diff --git a/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionProductRelationController.java b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionProductRelationController.java new file mode 100644 index 0000000..153ba62 --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionProductRelationController.java @@ -0,0 +1,76 @@ +package com.macro.mall.controller; + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.dto.SmsFlashPromotionProduct; +import com.macro.mall.model.SmsFlashPromotionProductRelation; +import com.macro.mall.service.SmsFlashPromotionProductRelationService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 限时购和商品关系管理Controller + * Created by macro on 2018/11/16. + */ +@Controller +@Api(tags = "SmsFlashPromotionProductRelationController", description = "限时购和商品关系管理") +@RequestMapping("/flashProductRelation") +public class SmsFlashPromotionProductRelationController { + @Autowired + private SmsFlashPromotionProductRelationService relationService; + @ApiOperation("批量选择商品添加关联") + @RequestMapping(value = "/create", method = RequestMethod.POST) + @ResponseBody + public Object create(@RequestBody List relationList) { + int count = relationService.create(relationList); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("修改关联相关信息") + @RequestMapping(value = "/update/{id}", method = RequestMethod.POST) + @ResponseBody + public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotionProductRelation relation) { + int count = relationService.update(id,relation); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("删除关联") + @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) + @ResponseBody + public Object delete(@PathVariable Long id) { + int count = relationService.delete(id); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("获取管理商品促销信息") + @RequestMapping(value = "/{id}", method = RequestMethod.GET) + @ResponseBody + public Object getItem(@PathVariable Long id) { + SmsFlashPromotionProductRelation relation = relationService.getItem(id); + return new CommonResult().success(relation); + } + + @ApiOperation("分页查询不同场次关联及商品信息") + @RequestMapping(value = "/list", method = RequestMethod.GET) + @ResponseBody + public Object list(@RequestParam(value = "flashPromotionId")Long flashPromotionId, + @RequestParam(value = "flashPromotionSessionId")Long flashPromotionSessionId, + @RequestParam(value = "pageSize",defaultValue = "5")Integer pageSize, + @RequestParam(value = "pageNum",defaultValue = "1")Integer pageNum) { + List flashPromotionProductList = relationService.list(flashPromotionId,flashPromotionSessionId,pageSize,pageNum); + return new CommonResult().pageSuccess(flashPromotionProductList); + } +} diff --git a/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionSessionController.java b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionSessionController.java new file mode 100644 index 0000000..e6b92ae --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/controller/SmsFlashPromotionSessionController.java @@ -0,0 +1,83 @@ +package com.macro.mall.controller; + +import com.macro.mall.dto.CommonResult; +import com.macro.mall.model.SmsFlashPromotionSession; +import com.macro.mall.service.SmsFlashPromotionSessionService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 限时购场次管理Controller + * Created by macro on 2018/11/16. + */ +@Controller +@Api(tags = "SmsFlashPromotionSessionController", description = "限时购场次管理") +@RequestMapping("/flashSession") +public class SmsFlashPromotionSessionController { + @Autowired + private SmsFlashPromotionSessionService flashPromotionSessionService; + @ApiOperation("添加场次") + @RequestMapping(value = "/create", method = RequestMethod.POST) + @ResponseBody + public Object create(@RequestBody SmsFlashPromotionSession promotionSession) { + int count = flashPromotionSessionService.create(promotionSession); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("修改场次") + @RequestMapping(value = "/update/{id}", method = RequestMethod.POST) + @ResponseBody + public Object update(@PathVariable Long id, @RequestBody SmsFlashPromotionSession promotionSession) { + int count = flashPromotionSessionService.update(id,promotionSession); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("修改启用状态") + @RequestMapping(value = "/update/status/{id}", method = RequestMethod.POST) + @ResponseBody + public Object updateStatus(@PathVariable Long id, Integer status) { + int count = flashPromotionSessionService.updateStatus(id,status); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("删除场次") + @RequestMapping(value = "/delete/{id}", method = RequestMethod.POST) + @ResponseBody + public Object delete(@PathVariable Long id) { + int count = flashPromotionSessionService.delete(id); + if(count>0){ + return new CommonResult().success(count); + } + return new CommonResult().failed(); + } + + @ApiOperation("获取场次详情") + @RequestMapping(value = "/{id}", method = RequestMethod.GET) + @ResponseBody + public Object getItem(@PathVariable Long id) { + SmsFlashPromotionSession promotionSession = flashPromotionSessionService.getItem(id); + return new CommonResult().success(promotionSession); + } + + @ApiOperation("根据状态获取全部场次") + @RequestMapping(value = "/list", method = RequestMethod.GET) + @ResponseBody + public Object list(Integer status) { + List promotionSessionList = flashPromotionSessionService.list(status); + return new CommonResult().pageSuccess(promotionSessionList); + } +} diff --git a/mall-admin/src/main/java/com/macro/mall/dao/SmsFlashPromotionProductRelationDao.java b/mall-admin/src/main/java/com/macro/mall/dao/SmsFlashPromotionProductRelationDao.java new file mode 100644 index 0000000..d574bcc --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/dao/SmsFlashPromotionProductRelationDao.java @@ -0,0 +1,17 @@ +package com.macro.mall.dao; + +import com.macro.mall.dto.SmsFlashPromotionProduct; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + +/** + * 限时购商品关联自定义Dao + * Created by macro on 2018/11/16. + */ +public interface SmsFlashPromotionProductRelationDao { + /** + * 获取限时购及相关商品信息 + */ + List getList(@Param("flashPromotionId") Long flashPromotionId, @Param("flashPromotionSessionId") Long flashPromotionSessionId); +} diff --git a/mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionProduct.java b/mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionProduct.java new file mode 100644 index 0000000..a3e5877 --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/dto/SmsFlashPromotionProduct.java @@ -0,0 +1,16 @@ +package com.macro.mall.dto; + +import com.macro.mall.model.PmsProduct; +import com.macro.mall.model.SmsFlashPromotionProductRelation; +import lombok.Getter; +import lombok.Setter; + +/** + * 限时购及商品信息封装 + * Created by macro on 2018/11/16. + */ +public class SmsFlashPromotionProduct extends SmsFlashPromotionProductRelation{ + @Getter + @Setter + private PmsProduct product; +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionProductRelationService.java b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionProductRelationService.java new file mode 100644 index 0000000..86dee8e --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionProductRelationService.java @@ -0,0 +1,42 @@ +package com.macro.mall.service; + +import com.macro.mall.dto.SmsFlashPromotionProduct; +import com.macro.mall.model.SmsFlashPromotionProductRelation; +import org.springframework.transaction.annotation.Transactional; + +import java.util.List; + +/** + * 限时购商品关联管理Service + * Created by macro on 2018/11/16. + */ +public interface SmsFlashPromotionProductRelationService { + /** + * 批量添加关联 + */ + @Transactional + int create(List relationList); + + /** + * 修改关联相关信息 + */ + int update(Long id, SmsFlashPromotionProductRelation relation); + + /** + * 删除关联 + */ + int delete(Long id); + + /** + * 获取关联详情 + */ + SmsFlashPromotionProductRelation getItem(Long id); + + /** + * 分页查询相关商品及促销信息 + * + * @param flashPromotionId 限时购id + * @param flashPromotionSessionId 限时购场次id + */ + List list(Long flashPromotionId, Long flashPromotionSessionId, Integer pageSize, Integer pageNum); +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionService.java b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionService.java new file mode 100644 index 0000000..eb8ced2 --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionService.java @@ -0,0 +1,41 @@ +package com.macro.mall.service; + +import com.macro.mall.model.SmsFlashPromotion; + +import java.util.List; + +/** + * 限时购活动管理Service + * Created by macro on 2018/11/16. + */ +public interface SmsFlashPromotionService { + /** + * 添加活动 + */ + int create(SmsFlashPromotion flashPromotion); + + /** + * 修改指定活动 + */ + int update(Long id, SmsFlashPromotion flashPromotion); + + /** + * 删除单个活动 + */ + int delete(Long id); + + /** + * 修改上下线状态 + */ + int updateStatus(Long id, Integer status); + + /** + * 获取详细信息 + */ + SmsFlashPromotion getItem(Long id); + + /** + * 分页查询活动 + */ + List list(String keyword, Integer pageSize, Integer pageNum); +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionSessionService.java b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionSessionService.java new file mode 100644 index 0000000..b67fcbb --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/SmsFlashPromotionSessionService.java @@ -0,0 +1,41 @@ +package com.macro.mall.service; + +import com.macro.mall.model.SmsFlashPromotionSession; + +import java.util.List; + +/** + * 限时购场次管理Service + * Created by macro on 2018/11/16. + */ +public interface SmsFlashPromotionSessionService { + /** + * 添加场次 + */ + int create(SmsFlashPromotionSession promotionSession); + + /** + * 修改场次 + */ + int update(Long id, SmsFlashPromotionSession promotionSession); + + /** + * 修改场次启用状态 + */ + int updateStatus(Long id, Integer status); + + /** + * 删除场次 + */ + int delete(Long id); + + /** + * 获取详情 + */ + SmsFlashPromotionSession getItem(Long id); + + /** + * 根据启用状态获取场次列表 + */ + List list(Integer status); +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionProductRelationServiceImpl.java b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionProductRelationServiceImpl.java new file mode 100644 index 0000000..a8733af --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionProductRelationServiceImpl.java @@ -0,0 +1,53 @@ +package com.macro.mall.service.impl; + +import com.github.pagehelper.PageHelper; +import com.macro.mall.dao.SmsFlashPromotionProductRelationDao; +import com.macro.mall.dto.SmsFlashPromotionProduct; +import com.macro.mall.mapper.SmsFlashPromotionProductRelationMapper; +import com.macro.mall.model.SmsFlashPromotionProductRelation; +import com.macro.mall.service.SmsFlashPromotionProductRelationService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.List; + +/** + * 限时购商品关联管理Service实现类 + * Created by macro on 2018/11/16. + */ +@Service +public class SmsFlashPromotionProductRelationServiceImpl implements SmsFlashPromotionProductRelationService { + @Autowired + private SmsFlashPromotionProductRelationMapper relationMapper; + @Autowired + private SmsFlashPromotionProductRelationDao relationDao; + @Override + public int create(List relationList) { + for (SmsFlashPromotionProductRelation relation : relationList) { + relationMapper.insert(relation); + } + return relationList.size(); + } + + @Override + public int update(Long id, SmsFlashPromotionProductRelation relation) { + relation.setId(id); + return relationMapper.updateByPrimaryKey(relation); + } + + @Override + public int delete(Long id) { + return relationMapper.deleteByPrimaryKey(id); + } + + @Override + public SmsFlashPromotionProductRelation getItem(Long id) { + return relationMapper.selectByPrimaryKey(id); + } + + @Override + public List list(Long flashPromotionId, Long flashPromotionSessionId, Integer pageSize, Integer pageNum) { + PageHelper.startPage(pageNum,pageSize); + return relationDao.getList(flashPromotionId,flashPromotionSessionId); + } +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionServiceImpl.java b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionServiceImpl.java new file mode 100644 index 0000000..d8f09ca --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionServiceImpl.java @@ -0,0 +1,63 @@ +package com.macro.mall.service.impl; + +import com.github.pagehelper.PageHelper; +import com.macro.mall.mapper.SmsFlashPromotionMapper; +import com.macro.mall.model.SmsFlashPromotion; +import com.macro.mall.model.SmsFlashPromotionExample; +import com.macro.mall.service.SmsFlashPromotionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; + +import java.util.Date; +import java.util.List; + +/** + * 限时购活动管理Service实现类 + * Created by macro on 2018/11/16. + */ +@Service +public class SmsFlashPromotionServiceImpl implements SmsFlashPromotionService { + @Autowired + private SmsFlashPromotionMapper flashPromotionMapper; + + @Override + public int create(SmsFlashPromotion flashPromotion) { + flashPromotion.setCreateTime(new Date()); + return flashPromotionMapper.insert(flashPromotion); + } + + @Override + public int update(Long id, SmsFlashPromotion flashPromotion) { + flashPromotion.setId(id); + return flashPromotionMapper.updateByPrimaryKey(flashPromotion); + } + + @Override + public int delete(Long id) { + return flashPromotionMapper.deleteByPrimaryKey(id); + } + + @Override + public int updateStatus(Long id, Integer status) { + SmsFlashPromotion flashPromotion = new SmsFlashPromotion(); + flashPromotion.setId(id); + flashPromotion.setStatus(status); + return flashPromotionMapper.updateByPrimaryKeySelective(flashPromotion); + } + + @Override + public SmsFlashPromotion getItem(Long id) { + return flashPromotionMapper.selectByPrimaryKey(id); + } + + @Override + public List list(String keyword, Integer pageSize, Integer pageNum) { + PageHelper.startPage(pageNum, pageSize); + SmsFlashPromotionExample example = new SmsFlashPromotionExample(); + if (!StringUtils.isEmpty(keyword)) { + example.createCriteria().andTitleLike("%" + keyword + "%"); + } + return flashPromotionMapper.selectByExample(example); + } +} diff --git a/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionSessionServiceImpl.java b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionSessionServiceImpl.java new file mode 100644 index 0000000..b23df92 --- /dev/null +++ b/mall-admin/src/main/java/com/macro/mall/service/impl/SmsFlashPromotionSessionServiceImpl.java @@ -0,0 +1,60 @@ +package com.macro.mall.service.impl; + +import com.macro.mall.mapper.SmsFlashPromotionSessionMapper; +import com.macro.mall.model.SmsFlashPromotionSession; +import com.macro.mall.model.SmsFlashPromotionSessionExample; +import com.macro.mall.service.SmsFlashPromotionSessionService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Date; +import java.util.List; + +/** + * 限时购场次管理Service实现类 + * Created by macro on 2018/11/16. + */ +@Service +public class SmsFlashPromotionSessionServiceImpl implements SmsFlashPromotionSessionService { + @Autowired + private SmsFlashPromotionSessionMapper promotionSessionMapper; + + @Override + public int create(SmsFlashPromotionSession promotionSession) { + promotionSession.setCreateTime(new Date()); + return promotionSessionMapper.insert(promotionSession); + } + + @Override + public int update(Long id, SmsFlashPromotionSession promotionSession) { + promotionSession.setId(id); + return promotionSessionMapper.updateByPrimaryKey(promotionSession); + } + + @Override + public int updateStatus(Long id, Integer status) { + SmsFlashPromotionSession promotionSession = new SmsFlashPromotionSession(); + promotionSession.setId(id); + promotionSession.setStatus(status); + return promotionSessionMapper.updateByPrimaryKeySelective(promotionSession); + } + + @Override + public int delete(Long id) { + return promotionSessionMapper.deleteByPrimaryKey(id); + } + + @Override + public SmsFlashPromotionSession getItem(Long id) { + return promotionSessionMapper.selectByPrimaryKey(id); + } + + @Override + public List list(Integer status) { + SmsFlashPromotionSessionExample example = new SmsFlashPromotionSessionExample(); + if (status != null) { + example.createCriteria().andStatusEqualTo(status); + } + return promotionSessionMapper.selectByExample(example); + } +} diff --git a/mall-admin/src/main/resources/dao/SmsFlashPromotionProductRelationDao.xml b/mall-admin/src/main/resources/dao/SmsFlashPromotionProductRelationDao.xml new file mode 100644 index 0000000..fb2a226 --- /dev/null +++ b/mall-admin/src/main/resources/dao/SmsFlashPromotionProductRelationDao.xml @@ -0,0 +1,26 @@ + + + + + + + + \ No newline at end of file