diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/controller/BmCompanyInfoController.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/controller/BmCompanyInfoController.java index 7b9fa01..cb08c8b 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/controller/BmCompanyInfoController.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/controller/BmCompanyInfoController.java @@ -7,10 +7,7 @@ import com.bonus.zlpt.bigscreen.service.BmCompanyInfoService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; -import java.util.Collections; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * 企业信息表(BmCompanyInfo)表控制层 @@ -64,31 +61,57 @@ public class BmCompanyInfoController extends BaseController { List list = bmCompanyInfoService.selectColtdList(); - Map> map = new HashMap<>(); + List voList = new ArrayList<>(); for (ColtdTypeVo coltdTypeVo : list) { - String companyType = coltdTypeVo.getCompanyType(); - map.put(companyType, map.getOrDefault(companyType, new HashMap<>())); - map.get(companyType).putIfAbsent("自有", new ColtdVo()); - map.get(companyType).putIfAbsent("在租", new ColtdVo()); - map.get(companyType).putIfAbsent("待租", new ColtdVo()); - - ColtdVo coltdVo = map.get(companyType).get(coltdTypeVo.getMaStatus()); - coltdVo.setCount(coltdVo.getCount() + 1); + TestVo testVo; + String maStatus = coltdTypeVo.getMaStatus(); + testVo = isExsit(companyType, voList); + if(testVo == null){ + testVo = new TestVo(); + voList.add(testVo); + testVo.setCompanyName(companyType); + } + ColtdVo coltdVo = getColtdVoByStatus(testVo.getColtdVo(),maStatus); + coltdVo.setCount(coltdVo.getCount()+1); coltdVo.getList().add(new LonVo(coltdTypeVo.getMaId(), coltdTypeVo.getLon(), coltdTypeVo.getLat())); } - return success(map); + return success(voList); } + private ColtdVo getColtdVoByStatus(List coltdVos, String maStatus) { + + for (ColtdVo coltdVo : coltdVos) { + if(maStatus.equals(coltdVo.getStatus())){ + return coltdVo; + } + } + return null; + + } + + private TestVo isExsit(String companyType,List testVos) { + + for (TestVo testVo : testVos) { + if(companyType.equals(testVo.getCompanyName())){ + return testVo; + } + } + return null; + } + + /** * 根据时间查询设备历史经纬度 - * @param time + * @param * @return */ - @GetMapping("/time-list/{time}") - public AjaxResult timeList(@PathVariable("time") String time) { - List list = bmCompanyInfoService.selectTimeList(time); + @GetMapping("/time-list/{beginTime}/{endTime}/{maId}") + public AjaxResult timeList(@PathVariable("beginTime") String beginTime, + @PathVariable("endTime") String endTime,@PathVariable("maId") String maId) + { + List list = bmCompanyInfoService.selectTimeList(beginTime, endTime, maId); return success(list); } } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/ColtdVo.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/ColtdVo.java index 16d47ba..7e0ff4c 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/ColtdVo.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/ColtdVo.java @@ -15,7 +15,8 @@ public class ColtdVo { this.count = 0; this.list = new ArrayList<>(); } - + //状态 + private String status; //总数 private int count; //经纬度 diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/LatVo.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/LatVo.java index 6869964..570d673 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/LatVo.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/LatVo.java @@ -2,15 +2,12 @@ package com.bonus.zlpt.bigscreen.domain.vo; import lombok.Data; -/** - * 经纬度返回类 - */ @Data public class LatVo { //经度 private String lon; - //纬度 + //维度 private String lat; } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/TestVo.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/TestVo.java new file mode 100644 index 0000000..8f9d3db --- /dev/null +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/domain/vo/TestVo.java @@ -0,0 +1,38 @@ +package com.bonus.zlpt.bigscreen.domain.vo; + +import lombok.Data; + +import java.util.*; + +@Data +public class TestVo { + + //企业类型 + private String companyName; + + private List coltdVo; + + private static Set set = new TreeSet<>(); + + static { + set.add("自有"); + set.add("待租"); + set.add("在租"); + } + + public TestVo(){ + this.coltdVo = new ArrayList<>(); + for (String s : set) { + ColtdVo coltdVo = new ColtdVo(); + coltdVo.setStatus(s); + this.coltdVo.add(coltdVo); + } + } + + + public void addColtdVo(ColtdVo coltdVo){ + + this.coltdVo.add(coltdVo); + } + +} diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/mapper/BmCompanyInfoMapper.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/mapper/BmCompanyInfoMapper.java index 3ee50fa..7fca227 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/mapper/BmCompanyInfoMapper.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/mapper/BmCompanyInfoMapper.java @@ -3,7 +3,9 @@ package com.bonus.zlpt.bigscreen.mapper; import com.bonus.zlpt.bigscreen.domain.vo.CoTypeVo; import com.bonus.zlpt.bigscreen.domain.vo.ColtdTypeVo; import com.bonus.zlpt.bigscreen.domain.vo.LatVo; +import com.bonus.zlpt.bigscreen.domain.vo.LonVo; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -31,9 +33,9 @@ public interface BmCompanyInfoMapper { /** * 根据时间查询设备历史经纬度 - * @param time + * @param * @return */ - List selectTimeList(String time); + List selectTimeList(@Param("beginTime") String beginTime, @Param("endTime") String endTime, @Param("maId") String maId); } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/BmCompanyInfoService.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/BmCompanyInfoService.java index 8ca955f..46dbf5a 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/BmCompanyInfoService.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/BmCompanyInfoService.java @@ -29,9 +29,9 @@ public interface BmCompanyInfoService { /** * 根据时间查询设备历史经纬度 - * @param time + * @param * @return */ - List selectTimeList(String time); + List selectTimeList(String beginTime, String endTime, String maId); } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java index bd850eb..e6bd0ba 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java +++ b/zlpt-modules/zlpt-bigScreen/src/main/java/com/bonus/zlpt/bigscreen/service/impl/BmCompanyInfoServiceImpl.java @@ -3,6 +3,7 @@ package com.bonus.zlpt.bigscreen.service.impl; import com.bonus.zlpt.bigscreen.domain.vo.CoTypeVo; import com.bonus.zlpt.bigscreen.domain.vo.ColtdTypeVo; import com.bonus.zlpt.bigscreen.domain.vo.LatVo; +import com.bonus.zlpt.bigscreen.domain.vo.LonVo; import com.bonus.zlpt.bigscreen.mapper.BmCompanyInfoMapper; import com.bonus.zlpt.bigscreen.service.BmCompanyInfoService; import org.springframework.beans.factory.annotation.Autowired; @@ -43,12 +44,12 @@ public class BmCompanyInfoServiceImpl implements BmCompanyInfoService { /** * 根据时间查询设备历史经纬度 - * @param time + * @param * @return */ @Override - public List selectTimeList(String time) { - return bmCompanyInfoMapper.selectTimeList(time); + public List selectTimeList(String beginTime, String endTime, String maId) { + return bmCompanyInfoMapper.selectTimeList(beginTime, endTime, maId); } } diff --git a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml index 581451a..817bb61 100644 --- a/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml +++ b/zlpt-modules/zlpt-bigScreen/src/main/resources/mapper/BmCompanyInfoMapper.xml @@ -34,6 +34,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" SELECT gh.lon AS lon, gh.lat AS lat FROM ma_dev_info md LEFT JOIN gps_his_info gh ON md.gps_code = gh.gps_code - WHERE gh.time = STR_TO_DATE(#{time}, '%Y.%m.%d') + + + and date_format( gh.time, '%Y-%m-%d' ) + BETWEEN date_format( #{beginTime}, '%Y-%m-%d' ) + and date_format( #{endTime}, '%Y-%m-%d' ) + + + and md.ma_id = #{maId} + + \ No newline at end of file diff --git a/zlpt-modules/zlpt-home/pom.xml b/zlpt-modules/zlpt-home/pom.xml index d9f8fcd..12187af 100644 --- a/zlpt-modules/zlpt-home/pom.xml +++ b/zlpt-modules/zlpt-home/pom.xml @@ -19,6 +19,12 @@ com.bonus.zlpt zlpt-common-swagger + + com.bonus.zlpt + zlpt-modules-file + 3.6.3 + compile + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java index cf09098..5304dc0 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmCarouselSetController.java @@ -1,11 +1,16 @@ package com.bonus.zlpt.home.controller; +import com.bonus.zlpt.common.core.web.controller.BaseController; +import com.bonus.zlpt.common.core.web.domain.AjaxResult; +import com.bonus.zlpt.common.core.web.page.TableDataInfo; +import com.bonus.zlpt.common.security.utils.SecurityUtils; +import com.bonus.zlpt.file.service.FileUploadTencentService; +import com.bonus.zlpt.home.pojo.BmCarouselSet; import com.bonus.zlpt.home.service.BmCarouselSetService; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; - +import java.util.List; /** * 轮播图配置(BmCarouselSet)表控制层 @@ -15,14 +20,71 @@ import javax.annotation.Resource; */ @RestController @RequestMapping("bmCarouselSet") -public class BmCarouselSetController { +public class BmCarouselSetController extends BaseController { /** * 服务对象 */ @Resource private BmCarouselSetService bmCarouselSetService; + @Resource + private FileUploadTencentService fileUploadTencentService; + /** + * 获取轮播图列表 + * @param + * @return + */ + @GetMapping("/list/{carName}/{beginTime}/{endTime}") + public TableDataInfo getCarouselChartList(@PathVariable("carName") String carName, @PathVariable("beginTime") String beginTime, @PathVariable("endTime") String endTime) + { + startPage(); + List list = bmCarouselSetService.selectBmCarouseList(carName, beginTime, endTime); + return getDataTable(list); + } + /** + * 新增轮播图信息 + * @param bmCarouselSet + * @return + */ + @PostMapping + public AjaxResult addCarouselChartInfo(@RequestBody BmCarouselSet bmCarouselSet) + { + return toAjax(bmCarouselSetService.insertConfig(bmCarouselSet)); + } + + /** + * 根据id查询轮播图信息 + * @param id + * @return + */ + @GetMapping("/{id}") + public AjaxResult getCarouselChartInfo(@PathVariable("id") String id) + { + return toAjax(bmCarouselSetService.selectListById(id)); + } + + /** + * 编辑轮播图信息 + * @param bmCarouselSet + * @return + */ + @PutMapping + public AjaxResult updateCarouselChartInfo(@RequestBody BmCarouselSet bmCarouselSet) + { + return toAjax(bmCarouselSetService.update(bmCarouselSet)); + } + + /** + * 删除轮播图信息 + * @param id + * @return + */ + @DeleteMapping("/{id}") + public AjaxResult delCarouselChartInfo(@PathVariable("id") String id) + { + return toAjax(bmCarouselSetService.deleteById(id)); + } } diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmTopicInfoController.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmTopicInfoController.java new file mode 100644 index 0000000..31c8159 --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/controller/BmTopicInfoController.java @@ -0,0 +1,104 @@ +package com.bonus.zlpt.home.controller; + +import com.bonus.zlpt.common.core.utils.poi.ExcelUtil; +import com.bonus.zlpt.common.core.web.controller.BaseController; +import com.bonus.zlpt.common.core.web.domain.AjaxResult; +import com.bonus.zlpt.common.core.web.page.TableDataInfo; +import com.bonus.zlpt.common.security.utils.SecurityUtils; +import com.bonus.zlpt.home.pojo.BmCarouselSet; +import com.bonus.zlpt.home.pojo.BmTopicDto; +import com.bonus.zlpt.home.pojo.BmTopicInfo; +import com.bonus.zlpt.home.service.BmTopicInfoService; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletResponse; +import java.util.List; + + +/** + * 专题资讯表(BmTopicInfo)表控制层 + * + * @author makejava + * @since 2023-12-04 09:48:36 + */ +@RestController +@RequestMapping("bmTopicInfo") +public class BmTopicInfoController extends BaseController { + /** + * 服务对象 + */ + @Resource + private BmTopicInfoService bmTopicInfoService; + + /** + * 获取专题资讯列表 + * @param bmTopicDto + * @return + */ + @GetMapping("/list") + public TableDataInfo getSpecialInfoList(@RequestBody BmTopicDto bmTopicDto) + { + startPage(); + List list = bmTopicInfoService.selectSpecialInfoList(bmTopicDto); + return getDataTable(list); + } + + /** + * 新增专题资讯信息 + * @param bmTopicInfo + * @return + */ + @PostMapping + public AjaxResult addCarouselChartInfo(@RequestBody BmTopicInfo bmTopicInfo) + { + return toAjax(bmTopicInfoService.insertConfig(bmTopicInfo)); + } + + /** + * 根据id查询资讯信息 + * @param id + * @return + */ + @GetMapping("/{id}") + public AjaxResult getSpecialInfo(@PathVariable("id") String id) + { + return toAjax(bmTopicInfoService.selectListById(id)); + } + + /** + * 编辑专题资讯信息 + * @param bmTopicInfo + * @return + */ + @PutMapping + public AjaxResult updateCarouselChartInfo(@RequestBody BmTopicInfo bmTopicInfo) + { + return toAjax(bmTopicInfoService.update(bmTopicInfo)); + } + + /** + * 删除专题资讯信息 + * @param id + * @return + */ + @DeleteMapping("/{id}") + public AjaxResult delSpecialInfo(@PathVariable("id") String id) + { + return toAjax(bmTopicInfoService.deleteById(id)); + } + + /** + * 导出专题资讯信息 + * @param response + * @param bmTopicDto + */ + @PostMapping("/export") + public void expSpecialInfo(HttpServletResponse response, BmTopicDto bmTopicDto) + { + List list = bmTopicInfoService.selectSpecialInfoList(bmTopicDto); + ExcelUtil util = new ExcelUtil(BmTopicInfo.class); + util.exportExcel(response, list, "专题资讯信息"); + } +} + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmCarouselSetMapper.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmCarouselSetMapper.java index e216870..ed0d504 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmCarouselSetMapper.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmCarouselSetMapper.java @@ -1,5 +1,10 @@ package com.bonus.zlpt.home.mapper; +import com.bonus.zlpt.home.pojo.BmCarouselSet; +import org.apache.ibatis.annotations.Param; + +import java.util.List; + /** * 轮播图配置(BmCarouselSet)表数据库访问层 * @@ -8,5 +13,39 @@ package com.bonus.zlpt.home.mapper; */ public interface BmCarouselSetMapper { + /** + * 获取轮播图列表 + * @param + * @return + */ + List selectBmCarouseList(@Param("carName") String carName, @Param("beginTime") String beginTime, @Param("endTime") String endTime); + + /** + * 新增轮播图信息 + * @param bmCarouselSet + * @return + */ + int insertConfig(BmCarouselSet bmCarouselSet); + + /** + * 根据id查询轮播图信息 + * @param id + * @return + */ + int selectListById(String id); + + /** + * 编辑轮播图信息 + * @param bmCarouselSet + * @return + */ + int update(BmCarouselSet bmCarouselSet); + + /** + * 删除轮播图信息 + * @param id + * @return + */ + int deleteById(String id); } diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmTopicInfoMapper.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmTopicInfoMapper.java new file mode 100644 index 0000000..fd278fc --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/mapper/BmTopicInfoMapper.java @@ -0,0 +1,51 @@ +package com.bonus.zlpt.home.mapper; + +import com.bonus.zlpt.home.pojo.BmTopicDto; +import com.bonus.zlpt.home.pojo.BmTopicInfo; + +import java.util.List; + +/** + * 专题资讯表(BmTopicInfo)表数据库访问层 + * + * @author makejava + * @since 2023-12-04 09:48:36 + */ +public interface BmTopicInfoMapper { + + /** + * 获取专题资讯列表 + * @param bmTopicDto + * @return + */ + List selectSpecialInfoList(BmTopicDto bmTopicDto); + + /** + * 新增专题资讯信息 + * @param bmTopicInfo + * @return + */ + int insertConfig(BmTopicInfo bmTopicInfo); + + /** + * 根据id查询资讯信息 + * @param id + * @return + */ + int selectListById(String id); + + /** + * 编辑专题资讯信息 + * @param bmTopicInfo + * @return + */ + int update(BmTopicInfo bmTopicInfo); + + /** + * 删除专题资讯信息 + * @param id + * @return + */ + int deleteById(String id); +} + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmCarouselSet.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmCarouselSet.java index bcad895..12072a3 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmCarouselSet.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmCarouselSet.java @@ -1,6 +1,6 @@ -package pojo; +package com.bonus.zlpt.home.pojo; -import java.io.Serializable; +import com.bonus.zlpt.common.core.annotation.Excel; import lombok.Data; /** @@ -11,26 +11,45 @@ import lombok.Data; */ @Data @SuppressWarnings("serial") -public class BmCarouselSet { - +public class BmCarouselSet { + //轮播图id + @Excel(name = "轮播图id") private Integer id; + //轮播图名称 + @Excel(name = "轮播图名称") private String carName; + //轮播图图片地址 + @Excel(name = "轮播图图片地址") private String carUrl; + //配置类型(0:资讯,1跳转地址)考虑用数据字典管理配置轮播图类型 + @Excel(name = "配置类型(0:资讯,1跳转地址)考虑用数据字典管理配置轮播图类型") private String type; + //配置跳转地址 + @Excel(name = "配置跳转地址") private String openUrl; + //是否启用(0不启用,1启用) + @Excel(name = "是否启用(0不启用,1启用") private String status; + //创建时间 + @Excel(name = "创建时间") private String createTime; + //创建人 + @Excel(name = "创建人") private String creator; + //排序 + @Excel(name = "排序") private String sort; - //是否删除 + + //是否删除(0 是, 1 否) + @Excel(name = "是否删除(0 是, 1 否)") private String isActive; } diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicDto.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicDto.java new file mode 100644 index 0000000..835e28b --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicDto.java @@ -0,0 +1,21 @@ +package com.bonus.zlpt.home.pojo; + +import lombok.Data; + +@Data +public class BmTopicDto { + + //名称 + private String topicName; + + //考虑数据字典管理专题资讯类型 + private Integer type; + + //开始时间 + private String beginTime; + + //结束时间 + private String endTime; +} + + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicInfo.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicInfo.java new file mode 100644 index 0000000..da41f44 --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/pojo/BmTopicInfo.java @@ -0,0 +1,50 @@ +package com.bonus.zlpt.home.pojo; + +import java.io.Serializable; + +import com.bonus.zlpt.common.core.annotation.Excel; +import lombok.Data; + +/** + * 专题资讯表(BmTopicInfo)表实体类 + * + * @author makejava + * @since 2023-12-04 09:48:36 + */ +@Data +@SuppressWarnings("serial") +public class BmTopicInfo { + + //专题资讯id + private Integer id; + + //名称 + @Excel(name = "名称") + private String topicName; + + //考虑数据字典管理专题资讯类型 + @Excel(name = "考虑数据字典管理专题资讯类型") + private Integer type; + + //浏览次数 + @Excel(name = "浏览次数") + private Integer viewNum; + + //内容 + @Excel(name = "内容") + private String content; + + //是否删除 + @Excel(name = "是否删除(0 是, 1 否)") + private String isActive; + + //创建人 + @Excel(name = "创建人") + private Integer creator; + + //创建时间 + @Excel(name = "创建时间") + private String createTime; + +} + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmCarouselSetService.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmCarouselSetService.java index 2f60510..f975122 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmCarouselSetService.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmCarouselSetService.java @@ -1,5 +1,9 @@ package com.bonus.zlpt.home.service; +import com.bonus.zlpt.home.pojo.BmCarouselSet; + +import java.util.List; + /** * 轮播图配置(BmCarouselSet)表服务接口 * @@ -8,5 +12,39 @@ package com.bonus.zlpt.home.service; */ public interface BmCarouselSetService { + /** + * 获取轮播图列表 + * @param + * @return + */ + List selectBmCarouseList(String carName, String beginTime, String endTime); + + /** + * 新增轮播图信息 + * @param bmCarouselSet + * @return + */ + int insertConfig(BmCarouselSet bmCarouselSet); + + /** + * 根据id查询轮播图信息 + * @param id + * @return + */ + int selectListById(String id); + + /** + * 编辑轮播图信息 + * @param bmCarouselSet + * @return + */ + int update(BmCarouselSet bmCarouselSet); + + /** + * 删除轮播图信息 + * @param id + * @return + */ + int deleteById(String id); } diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmTopicInfoService.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmTopicInfoService.java new file mode 100644 index 0000000..65ce533 --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/BmTopicInfoService.java @@ -0,0 +1,51 @@ +package com.bonus.zlpt.home.service; + +import com.bonus.zlpt.home.pojo.BmTopicDto; +import com.bonus.zlpt.home.pojo.BmTopicInfo; + +import java.util.List; + +/** + * 专题资讯表(BmTopicInfo)表服务接口 + * + * @author makejava + * @since 2023-12-04 09:48:36 + */ +public interface BmTopicInfoService { + + /** + * 获取专题资讯列表 + * @param bmTopicDto + * @return + */ + List selectSpecialInfoList(BmTopicDto bmTopicDto); + + /** + * 新增专题资讯信息 + * @param bmTopicInfo + * @return + */ + int insertConfig(BmTopicInfo bmTopicInfo); + + /** + * 根据id查询资讯信息 + * @param id + * @return + */ + int selectListById(String id); + + /** + * 编辑专题资讯信息 + * @param bmTopicInfo + * @return + */ + int update(BmTopicInfo bmTopicInfo); + + /** + * 删除专题资讯信息 + * @param id + * @return + */ + int deleteById(String id); +} + diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmCarouselSetServiceImpl.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmCarouselSetServiceImpl.java index 74be757..b6ef5d0 100644 --- a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmCarouselSetServiceImpl.java +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmCarouselSetServiceImpl.java @@ -1,8 +1,13 @@ package com.bonus.zlpt.home.service.impl; +import com.bonus.zlpt.home.mapper.BmCarouselSetMapper; +import com.bonus.zlpt.home.pojo.BmCarouselSet; import com.bonus.zlpt.home.service.BmCarouselSetService; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; + /** * 轮播图配置(BmCarouselSet)表服务实现类 * @@ -12,5 +17,57 @@ import org.springframework.stereotype.Service; @Service("bmCarouselSetService") public class BmCarouselSetServiceImpl implements BmCarouselSetService { + @Resource + private BmCarouselSetMapper bmCarouselSetMapper; + + /** + * 获取轮播图列表 + * @param + * @return + */ + @Override + public List selectBmCarouseList(String carName, String beginTime, String endTime) { + return bmCarouselSetMapper.selectBmCarouseList(carName, beginTime, endTime); + } + + /** + * 新增轮播图信息 + * @param bmCarouselSet + * @return + */ + @Override + public int insertConfig(BmCarouselSet bmCarouselSet) { + return bmCarouselSetMapper.insertConfig(bmCarouselSet); + } + + /** + * 根据id查询轮播图信息 + * @param id + * @return + */ + @Override + public int selectListById(String id) { + return bmCarouselSetMapper.selectListById(id); + } + + /** + * 编辑轮播图信息 + * @param bmCarouselSet + * @return + */ + @Override + public int update(BmCarouselSet bmCarouselSet) { + return bmCarouselSetMapper.update(bmCarouselSet); + } + + /** + * 删除轮播图信息 + * @param id + * @return + */ + @Override + public int deleteById(String id) { + return bmCarouselSetMapper.deleteById(id); + } } diff --git a/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmTopicInfoServiceImpl.java b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmTopicInfoServiceImpl.java new file mode 100644 index 0000000..0d121fb --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/java/com/bonus/zlpt/home/service/impl/BmTopicInfoServiceImpl.java @@ -0,0 +1,73 @@ +package com.bonus.zlpt.home.service.impl; + +import com.bonus.zlpt.home.mapper.BmTopicInfoMapper; +import com.bonus.zlpt.home.pojo.BmTopicDto; +import com.bonus.zlpt.home.pojo.BmTopicInfo; +import com.bonus.zlpt.home.service.BmTopicInfoService; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.List; + +/** + * 专题资讯表(BmTopicInfo)表服务实现类 + * + * @author makejava + * @since 2023-12-04 09:48:36 + */ +@Service("bmTopicInfoService") +public class BmTopicInfoServiceImpl implements BmTopicInfoService { + + @Resource + private BmTopicInfoMapper bmTopicInfoMapper; + /** + * 获取专题资讯列表 + * @param bmTopicDto + * @return + */ + @Override + public List selectSpecialInfoList(BmTopicDto bmTopicDto) { + return bmTopicInfoMapper.selectSpecialInfoList(bmTopicDto); + } + + /** + * 新增专题资讯信息 + * @param bmTopicInfo + * @return + */ + @Override + public int insertConfig(BmTopicInfo bmTopicInfo) { + return bmTopicInfoMapper.insertConfig(bmTopicInfo); + } + + /** + * 根据id查询资讯信息 + * @param id + * @return + */ + @Override + public int selectListById(String id) { + return bmTopicInfoMapper.selectListById(id); + } + + /** + * 编辑专题资讯信息 + * @param bmTopicInfo + * @return + */ + @Override + public int update(BmTopicInfo bmTopicInfo) { + return bmTopicInfoMapper.update(bmTopicInfo); + } + + /** + * 删除专题资讯信息 + * @param id + * @return + */ + @Override + public int deleteById(String id) { + return bmTopicInfoMapper.deleteById(id); + } +} + diff --git a/zlpt-modules/zlpt-home/src/main/resources/mapper/BmCarouselSetMapper.xml b/zlpt-modules/zlpt-home/src/main/resources/mapper/BmCarouselSetMapper.xml new file mode 100644 index 0000000..e844d1f --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/resources/mapper/BmCarouselSetMapper.xml @@ -0,0 +1,65 @@ + + + + + + select id, car_name, car_url, type, open_url, status, create_time, creator, sort, is_active + from bm_carousel_set + + + + insert into bm_carousel_set ( + car_name, + car_url, + open_url, + status, + creator, + sort, + create_time + )values( + #{carName}, + #{carUrl}, + #{openUrl}, + #{status}, + #{creator}, + #{sort}, + sysdate() + ) + + + + update bm_carousel_set + + id = #{id}, + car_name = #{carName}, + car_url = #{carUrl}, + open_url = #{openUrl}, + status = #{status}, + + + + + update bm_carousel_set set is_active = '0' where id = #{id} + + + + + + \ No newline at end of file diff --git a/zlpt-modules/zlpt-home/src/main/resources/mapper/BmTopicInfoMapper.xml b/zlpt-modules/zlpt-home/src/main/resources/mapper/BmTopicInfoMapper.xml new file mode 100644 index 0000000..dd18710 --- /dev/null +++ b/zlpt-modules/zlpt-home/src/main/resources/mapper/BmTopicInfoMapper.xml @@ -0,0 +1,63 @@ + + + + + + select id, topic_name, type, view_num, content, is_active, creator, create_time + from bm_topic_info + + + + insert into bm_topic_info ( + topic_name, + type, + view_num, + content, + creator, + create_time + )values( + #{topicName}, + #{type}, + #{openUrl}, + #{content}, + #{creator}, + sysdate() + ) + + + + update bm_topic_info + + id = #{id}, + topic_name = #{topicName}, + type = #{type}, + view_num = #{viewNum}, + content = #{content}, + + + + + update bm_topic_info set is_active = '0' where id = #{id} + + + + + + \ No newline at end of file