轮播图及专题资讯
This commit is contained in:
parent
0df8375a0c
commit
3699da73e3
|
|
@ -0,0 +1,16 @@
|
|||
package com.bonus.zlpt.common.core.domain.equip.dto;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
|
||||
public class InforMationDto extends DevInfo {
|
||||
|
||||
|
||||
private String lon;
|
||||
|
||||
private String lat;
|
||||
}
|
||||
|
|
@ -0,0 +1,109 @@
|
|||
package com.bonus.zlpt.company.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.company.domain.MaUserCollect;
|
||||
import com.bonus.zlpt.company.domain.ServiceGreementInfo;
|
||||
import com.bonus.zlpt.company.service.ServiceGreementInfoService;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselDto;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselSet;
|
||||
import com.bonus.zlpt.home.pojo.BmTopicDto;
|
||||
import com.bonus.zlpt.home.pojo.BmTopicInfo;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 隐私服务协议表(ServiceGreementInfo)表控制层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-04 16:32:02
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("serviceGreementInfo")
|
||||
public class ServiceGreementInfoController extends BaseController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private ServiceGreementInfoService serviceGreementInfoService;
|
||||
|
||||
/**
|
||||
* 获取隐私协议模板列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo getPrivacyAgreementTemplateList(@RequestBody ServiceGreementInfo dto)
|
||||
{
|
||||
startPage(dto.getPage(), dto.getPageSize());
|
||||
List<ServiceGreementInfo> list = serviceGreementInfoService.selectGreementInfoList(dto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询隐私协议模板信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getListById(@PathVariable("id") int id)
|
||||
{
|
||||
return toAjax(serviceGreementInfoService.selectListById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/add")
|
||||
public AjaxResult addPrivacyAgreementTemplateList(@RequestBody ServiceGreementInfo dto)
|
||||
{
|
||||
serviceGreementInfoService.insertConfig(dto);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出隐私协议模板信息
|
||||
* @param response
|
||||
* @param dto
|
||||
*/
|
||||
@PostMapping("/export")
|
||||
public void expPrivacyAgreementTemplate(HttpServletResponse response, ServiceGreementInfo dto)
|
||||
{
|
||||
List<ServiceGreementInfo> list = serviceGreementInfoService.selectGreementInfoList(dto);
|
||||
ExcelUtil<ServiceGreementInfo> util = new ExcelUtil<ServiceGreementInfo>(ServiceGreementInfo.class);
|
||||
util.exportExcel(response, list, "隐私协议模板信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@PutMapping("/update")
|
||||
public AjaxResult updatePrivacyAgreementTemplateList(@RequestBody ServiceGreementInfo dto)
|
||||
{
|
||||
serviceGreementInfoService.update(dto);
|
||||
return success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除隐私协议模板
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@DeleteMapping("/{id}")
|
||||
public AjaxResult delCarouselChartInfo(@PathVariable("id") int id)
|
||||
{
|
||||
serviceGreementInfoService.delete(id);
|
||||
return success();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package com.bonus.zlpt.company.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import java.io.Serializable;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 服务协议表(ServiceGreementInfo)表实体类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-04 16:32:02
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class ServiceGreementInfo {
|
||||
//协议id
|
||||
private Integer serviceId;
|
||||
|
||||
//隐私协议名称
|
||||
private String serviceName;
|
||||
|
||||
//创建时间
|
||||
private Date createTime;
|
||||
|
||||
//创建人
|
||||
private Integer userId;
|
||||
|
||||
//协议状态(0 启用, 1 停用)
|
||||
private String status;
|
||||
|
||||
//协议url路径
|
||||
private String fileUrl;
|
||||
|
||||
//页面
|
||||
private Integer page;
|
||||
|
||||
//条数
|
||||
private Integer pageSize;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
package com.bonus.zlpt.company.mapper;
|
||||
|
||||
import com.bonus.zlpt.company.domain.ServiceGreementInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务协议表(ServiceGreementInfo)表数据库访问层
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-04 16:32:02
|
||||
*/
|
||||
public interface ServiceGreementInfoMapper {
|
||||
|
||||
/**
|
||||
* 获取隐私协议模板列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ServiceGreementInfo> selectGreementInfoList(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 根据id查询隐私协议模板信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(int id);
|
||||
|
||||
/**
|
||||
* 新增隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void insertConfig(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 新增协议url路径
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void insertAttachment(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 编辑隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void update(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 修改协议url路径
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void updateAttachment(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 根据id删除隐私协议模板
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void delete(int id);
|
||||
|
||||
/**
|
||||
* 根据id删除隐私协议模板
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(int id);
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,50 @@
|
|||
package com.bonus.zlpt.company.service;
|
||||
|
||||
import com.bonus.zlpt.company.domain.ServiceGreementInfo;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务协议表(ServiceGreementInfo)表服务接口
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-04 16:32:06
|
||||
*/
|
||||
public interface ServiceGreementInfoService {
|
||||
|
||||
/**
|
||||
* 获取隐私协议模板列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
List<ServiceGreementInfo> selectGreementInfoList(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 根据id查询隐私协议模板信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(int id);
|
||||
|
||||
/**
|
||||
* 新增隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
void insertConfig(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 编辑隐私协议模板信息
|
||||
* @param dto
|
||||
*/
|
||||
void update(ServiceGreementInfo dto);
|
||||
|
||||
/**
|
||||
* 根据id删除隐私协议模板
|
||||
* @param id
|
||||
*/
|
||||
void delete(int id);
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,79 @@
|
|||
package com.bonus.zlpt.company.service.impl;
|
||||
|
||||
import com.bonus.zlpt.company.domain.ServiceGreementInfo;
|
||||
import com.bonus.zlpt.company.mapper.ServiceGreementInfoMapper;
|
||||
import com.bonus.zlpt.company.service.ServiceGreementInfoService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 服务协议表(ServiceGreementInfo)表服务实现类
|
||||
*
|
||||
* @author makejava
|
||||
* @since 2023-12-04 16:32:06
|
||||
*/
|
||||
@Service("serviceGreementInfoService")
|
||||
public class ServiceGreementInfoServiceImpl implements ServiceGreementInfoService {
|
||||
|
||||
@Resource
|
||||
private ServiceGreementInfoMapper mapper;
|
||||
|
||||
/**
|
||||
* 获取隐私协议模板列表
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ServiceGreementInfo> selectGreementInfoList(ServiceGreementInfo dto) {
|
||||
return mapper.selectGreementInfoList(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id查询隐私协议模板信息
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int selectListById(int id) {
|
||||
return mapper.selectListById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
@Transactional
|
||||
public void insertConfig(ServiceGreementInfo dto) {
|
||||
mapper.insertConfig(dto);
|
||||
mapper.insertAttachment(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑隐私协议模板信息
|
||||
* @param dto
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void update(ServiceGreementInfo dto) {
|
||||
mapper.update(dto);
|
||||
mapper.updateAttachment(dto);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除隐私协议模板
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void delete(int id) {
|
||||
mapper.delete(id);
|
||||
mapper.deleteById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,71 @@
|
|||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.bonus.zlpt.company.mapper.ServiceGreementInfoMapper">
|
||||
|
||||
<insert id="insertConfig">
|
||||
insert into service_greement_info (
|
||||
<if test="serviceId != null and serviceId != '' ">service_id,</if>
|
||||
<if test="serviceName != null and serviceName != '' ">service_name,</if>
|
||||
<if test="userId != null and userId != '' ">user_id,</if>
|
||||
<if test="status != null and status != '' ">status,</if>
|
||||
create_time
|
||||
)values(
|
||||
<if test="serviceId != null and serviceId != '' ">#{serviceId},</if>
|
||||
<if test="serviceName != null and serviceName != ''">#{serviceName},</if>
|
||||
<if test="userId != null and userId != ''">#{userId},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
sysdate()
|
||||
)
|
||||
</insert>
|
||||
|
||||
<insert id="insertAttachment">
|
||||
insert into sys_file_info (
|
||||
<if test="serviceId != null and serviceId != '' ">model_id,</if>
|
||||
<if test="fileUrl != null and fileUrl != '' ">file_url,</if>
|
||||
)values(
|
||||
<if test="serviceId != null and serviceId != '' ">#{serviceId},</if>
|
||||
<if test="fileUrl != null and fileUrl != '' ">#{fileUrl},</if>
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update service_greement_info
|
||||
<set>
|
||||
<if test="serviceName != null and serviceName != ''">service_name = #{serviceName},</if>
|
||||
<if test="userId != null and userId != ''">userId = #{userId},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
</set>
|
||||
</update>
|
||||
|
||||
<update id="updateAttachment">
|
||||
update sys_file_info
|
||||
<set>
|
||||
<if test="fileUrl != null and fileUrl != ''">file_url = #{fileUrl},</if>
|
||||
</set>
|
||||
</update>
|
||||
|
||||
<delete id="delete">
|
||||
delete from service_greement_info
|
||||
where service_id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteById">
|
||||
delete from sys_file_info
|
||||
where model_id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectListById" resultType="java.lang.Integer">
|
||||
select sg.service_id, sg.status, sf.file_url
|
||||
from service_greement_info sg
|
||||
left join sys_file_info sf on sg.service_id = sf.model_id
|
||||
where sg.service_id = #{id}
|
||||
</select>
|
||||
|
||||
<select id="selectGreementInfoList" resultType="com.bonus.zlpt.company.domain.ServiceGreementInfo">
|
||||
select sg.service_id, sg.status, sf.file_url
|
||||
from service_greement_info sg
|
||||
left join sys_file_info sf on sg.service_id = sf.model_id
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -2,6 +2,7 @@ package com.bonus.zlpt.equip.controller;
|
|||
|
||||
import java.util.List;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.equip.dto.InforMationDto;
|
||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||
import com.bonus.zlpt.common.core.utils.poi.ExcelUtil;
|
||||
import com.bonus.zlpt.common.core.web.controller.BaseController;
|
||||
|
|
@ -96,4 +97,17 @@ public class DevInfoController extends BaseController
|
|||
{
|
||||
return toAjax(devInfoService.deleteDevInfoByMaIds(maIds));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 设备信息录入
|
||||
* @param inforMationDto
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/insertInforMationDto")
|
||||
public AjaxResult insertInforMationDto(@RequestBody InforMationDto inforMationDto)
|
||||
{
|
||||
return toAjax(devInfoService.insertInforMationDto(inforMationDto));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ package com.bonus.zlpt.equip.mapper;
|
|||
import java.util.List;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||
import com.bonus.zlpt.common.core.domain.equip.dto.InforMationDto;
|
||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 设备信息Mapper接口
|
||||
|
|
@ -71,5 +73,11 @@ public interface DevInfoMapper
|
|||
*/
|
||||
public int deleteDevInfoByMaIds(Long[] maIds);
|
||||
|
||||
/**
|
||||
* 设备信息录入
|
||||
* @param inforMationDto
|
||||
* @return
|
||||
*/
|
||||
int insertLon(@Param("dto") InforMationDto inforMationDto);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,9 +1,8 @@
|
|||
package com.bonus.zlpt.equip.service;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import com.bonus.zlpt.common.core.domain.equip.DevInfo;
|
||||
import com.bonus.zlpt.common.core.domain.equip.dto.InforMationDto;
|
||||
import com.bonus.zlpt.common.core.domain.equip.vo.DevInfoVo;
|
||||
|
||||
/**
|
||||
|
|
@ -70,5 +69,11 @@ public interface IDevInfoService
|
|||
*/
|
||||
public int deleteDevInfoByMaId(Long maId);
|
||||
|
||||
public Map<String, Integer> sumType();
|
||||
/**
|
||||
* 设备信息录入
|
||||
* @param inforMationDto
|
||||
* @return
|
||||
*/
|
||||
int insertInforMationDto(InforMationDto inforMationDto);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -188,6 +188,20 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</trim>
|
||||
</insert>
|
||||
|
||||
<insert id="insertLon">
|
||||
insert into gps_real_info
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="dto.gpsCode != null and dto.gpsCode != ''">gps_code,</if>
|
||||
<if test="dto.lon != null and dto.lon !=''">lon,</if>
|
||||
<if test="dto.lat != null and dto.lat != ''">lat,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="dto.gpsCode != null and dto.gpsCode != ''">#{dto.gpsCode},</if>
|
||||
<if test="dto.lon != null and dto.lon !=''">#{dto.lon},</if>
|
||||
<if test="dto.lat != null and dto.lat != ''">#{dto.lat},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateDevInfo" parameterType="com.bonus.zlpt.common.core.domain.equip.DevInfo">
|
||||
update ma_dev_info
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ 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.home.pojo.BmCarouselDto;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselSet;
|
||||
import com.bonus.zlpt.home.service.BmCarouselSetService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
|
@ -26,18 +27,16 @@ public class BmCarouselSetController extends BaseController {
|
|||
@Resource
|
||||
private BmCarouselSetService bmCarouselSetService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取轮播图列表
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list/{carName}/{beginTime}/{endTime}")
|
||||
public TableDataInfo getCarouselChartList(@PathVariable("carName") String carName, @PathVariable("beginTime") String beginTime, @PathVariable("endTime") String endTime)
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo getCarouselChartList(@RequestBody BmCarouselDto bmCarouselDto)
|
||||
{
|
||||
startPage();
|
||||
List<BmCarouselSet> list = bmCarouselSetService.selectBmCarouseList(carName, beginTime, endTime);
|
||||
startPage(bmCarouselDto.getPage(), bmCarouselDto.getPageSize());
|
||||
List<BmCarouselSet> list = bmCarouselSetService.selectBmCarouseList(bmCarouselDto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
@ -46,9 +45,11 @@ public class BmCarouselSetController extends BaseController {
|
|||
* @param bmCarouselSet
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public AjaxResult addCarouselChartInfo(@RequestBody BmCarouselSet bmCarouselSet)
|
||||
{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
bmCarouselSet.setCreator(userId.intValue());
|
||||
return toAjax(bmCarouselSetService.insertConfig(bmCarouselSet));
|
||||
}
|
||||
|
||||
|
|
@ -58,9 +59,10 @@ public class BmCarouselSetController extends BaseController {
|
|||
* @return
|
||||
*/
|
||||
@GetMapping("/{id}")
|
||||
public AjaxResult getCarouselChartInfo(@PathVariable("id") String id)
|
||||
public AjaxResult getCarouselChartInfo(@PathVariable("id") int id)
|
||||
{
|
||||
return toAjax(bmCarouselSetService.selectListById(id));
|
||||
BmCarouselSet bmCarouselSet = bmCarouselSetService.selectListById(id);
|
||||
return success(bmCarouselSet);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -68,7 +70,7 @@ public class BmCarouselSetController extends BaseController {
|
|||
* @param bmCarouselSet
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
@PutMapping("/update")
|
||||
public AjaxResult updateCarouselChartInfo(@RequestBody BmCarouselSet bmCarouselSet)
|
||||
{
|
||||
return toAjax(bmCarouselSetService.update(bmCarouselSet));
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@ 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;
|
||||
|
|
@ -15,7 +14,6 @@ import javax.annotation.Resource;
|
|||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 专题资讯表(BmTopicInfo)表控制层
|
||||
*
|
||||
|
|
@ -36,10 +34,10 @@ public class BmTopicInfoController extends BaseController {
|
|||
* @param bmTopicDto
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/list")
|
||||
@PostMapping("/list")
|
||||
public TableDataInfo getSpecialInfoList(@RequestBody BmTopicDto bmTopicDto)
|
||||
{
|
||||
startPage();
|
||||
startPage(bmTopicDto.getPage(), bmTopicDto.getPageSize());
|
||||
List<BmTopicInfo> list = bmTopicInfoService.selectSpecialInfoList(bmTopicDto);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
|
@ -49,9 +47,11 @@ public class BmTopicInfoController extends BaseController {
|
|||
* @param bmTopicInfo
|
||||
* @return
|
||||
*/
|
||||
@PostMapping
|
||||
@PostMapping("/add")
|
||||
public AjaxResult addCarouselChartInfo(@RequestBody BmTopicInfo bmTopicInfo)
|
||||
{
|
||||
Long userId = SecurityUtils.getUserId();
|
||||
bmTopicInfo.setCreator(userId.intValue());
|
||||
return toAjax(bmTopicInfoService.insertConfig(bmTopicInfo));
|
||||
}
|
||||
|
||||
|
|
@ -63,7 +63,8 @@ public class BmTopicInfoController extends BaseController {
|
|||
@GetMapping("/{id}")
|
||||
public AjaxResult getSpecialInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return toAjax(bmTopicInfoService.selectListById(id));
|
||||
BmTopicInfo bmTopicInfo = bmTopicInfoService.selectListById(id);
|
||||
return success(bmTopicInfo);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -71,7 +72,7 @@ public class BmTopicInfoController extends BaseController {
|
|||
* @param bmTopicInfo
|
||||
* @return
|
||||
*/
|
||||
@PutMapping
|
||||
@PutMapping("/update")
|
||||
public AjaxResult updateCarouselChartInfo(@RequestBody BmTopicInfo bmTopicInfo)
|
||||
{
|
||||
return toAjax(bmTopicInfoService.update(bmTopicInfo));
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
package com.bonus.zlpt.home.mapper;
|
||||
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselDto;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselSet;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
|
@ -18,7 +18,7 @@ public interface BmCarouselSetMapper {
|
|||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<BmCarouselSet> selectBmCarouseList(@Param("carName") String carName, @Param("beginTime") String beginTime, @Param("endTime") String endTime);
|
||||
List<BmCarouselSet> selectBmCarouseList(BmCarouselDto bmCarouselDto);
|
||||
|
||||
/**
|
||||
* 新增轮播图信息
|
||||
|
|
@ -32,7 +32,7 @@ public interface BmCarouselSetMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(String id);
|
||||
BmCarouselSet selectListById(int id);
|
||||
|
||||
/**
|
||||
* 编辑轮播图信息
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface BmTopicInfoMapper {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(String id);
|
||||
BmTopicInfo selectListById(String id);
|
||||
|
||||
/**
|
||||
* 编辑专题资讯信息
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package com.bonus.zlpt.home.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class BmCarouselDto {
|
||||
|
||||
//轮播图名称
|
||||
private String carName;
|
||||
|
||||
//开始时间
|
||||
private String beginTime;
|
||||
|
||||
//结束时间
|
||||
private String endTime;
|
||||
|
||||
//页面
|
||||
private Integer page;
|
||||
|
||||
//条数
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
|
@ -40,9 +40,12 @@ public class BmCarouselSet {
|
|||
@Excel(name = "创建时间")
|
||||
private String createTime;
|
||||
|
||||
//创建人
|
||||
//创建人id
|
||||
@Excel(name = "创建人")
|
||||
private String creator;
|
||||
private Integer creator;
|
||||
|
||||
//创建人
|
||||
private String createBy;
|
||||
|
||||
//排序
|
||||
@Excel(name = "排序")
|
||||
|
|
|
|||
|
|
@ -16,6 +16,12 @@ public class BmTopicDto {
|
|||
|
||||
//结束时间
|
||||
private String endTime;
|
||||
|
||||
//页面
|
||||
private Integer page;
|
||||
|
||||
//条数
|
||||
private Integer pageSize;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.bonus.zlpt.home.service;
|
||||
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselDto;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselSet;
|
||||
|
||||
import java.util.List;
|
||||
|
|
@ -17,7 +18,7 @@ public interface BmCarouselSetService {
|
|||
* @param
|
||||
* @return
|
||||
*/
|
||||
List<BmCarouselSet> selectBmCarouseList(String carName, String beginTime, String endTime);
|
||||
List<BmCarouselSet> selectBmCarouseList(BmCarouselDto bmCarouselDto);
|
||||
|
||||
/**
|
||||
* 新增轮播图信息
|
||||
|
|
@ -31,7 +32,7 @@ public interface BmCarouselSetService {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(String id);
|
||||
BmCarouselSet selectListById(int id);
|
||||
|
||||
/**
|
||||
* 编辑轮播图信息
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@ public interface BmTopicInfoService {
|
|||
* @param id
|
||||
* @return
|
||||
*/
|
||||
int selectListById(String id);
|
||||
BmTopicInfo selectListById(String id);
|
||||
|
||||
/**
|
||||
* 编辑专题资讯信息
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
package com.bonus.zlpt.home.service.impl;
|
||||
|
||||
import com.bonus.zlpt.home.mapper.BmCarouselSetMapper;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselDto;
|
||||
import com.bonus.zlpt.home.pojo.BmCarouselSet;
|
||||
import com.bonus.zlpt.home.service.BmCarouselSetService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
|
@ -26,8 +27,8 @@ public class BmCarouselSetServiceImpl implements BmCarouselSetService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<BmCarouselSet> selectBmCarouseList(String carName, String beginTime, String endTime) {
|
||||
return bmCarouselSetMapper.selectBmCarouseList(carName, beginTime, endTime);
|
||||
public List<BmCarouselSet> selectBmCarouseList(BmCarouselDto bmCarouselDto) {
|
||||
return bmCarouselSetMapper.selectBmCarouseList(bmCarouselDto);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -46,7 +47,7 @@ public class BmCarouselSetServiceImpl implements BmCarouselSetService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int selectListById(String id) {
|
||||
public BmCarouselSet selectListById(int id) {
|
||||
return bmCarouselSetMapper.selectListById(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class BmTopicInfoServiceImpl implements BmTopicInfoService {
|
|||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int selectListById(String id) {
|
||||
public BmTopicInfo selectListById(String id) {
|
||||
return bmTopicInfoMapper.selectListById(id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.zlpt.home.mapper.BmCarouselSetMapper">
|
||||
|
||||
<sql id="selectBmCarouseVo">
|
||||
select id, car_name, car_url, type, open_url, status, create_time, creator, sort, is_active
|
||||
from bm_carousel_set
|
||||
select id, car_name, car_url, type, open_url, bc.status, bc.create_time, su.user_name AS createBy, sort, is_active
|
||||
from bm_carousel_set bc
|
||||
left join sys_user su on bc.creator = su.user_id
|
||||
</sql>
|
||||
|
||||
<insert id="insertConfig">
|
||||
|
|
@ -15,29 +16,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="carUrl != null and carUrl != '' ">car_url,</if>
|
||||
<if test="openUrl != null and openUrl != '' ">open_url,</if>
|
||||
<if test="status != null and status != '' ">status,</if>
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
<if test="sort != null and sort != ''">sort,</if>
|
||||
create_time
|
||||
creator,
|
||||
create_time,
|
||||
is_active
|
||||
)values(
|
||||
<if test="carName != null and carName != ''">#{carName},</if>
|
||||
<if test="carUrl != null and carUrl != ''">#{carUrl},</if>
|
||||
<if test="openUrl != null and openUrl != ''">#{openUrl},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
<if test="sort != null and sort != ''">#{sort},</if>
|
||||
sysdate()
|
||||
#{creator},
|
||||
sysdate(),
|
||||
1
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update bm_carousel_set
|
||||
<set>
|
||||
<if test="id != null and id != ''">id = #{id},</if>
|
||||
<if test="carName != null and carName != ''">car_name = #{carName},</if>
|
||||
<if test="carUrl != null and carUrl != ''">car_url = #{carUrl},</if>
|
||||
<if test="openUrl != null and openUrl != ''">open_url = #{openUrl},</if>
|
||||
<if test="status != null and status != ''">status = #{status},</if>
|
||||
<if test="sort != null and sort != ''">sort = #{sort},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
|
|
@ -48,17 +52,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectBmCarouseVo"/>
|
||||
<where>
|
||||
<if test="carName != null and carName != ''">
|
||||
AND car_name like concat('%', #{carName}, '%')
|
||||
AND bc.car_name like concat('%', #{carName}, '%')
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
||||
and date_format( create_time, '%Y-%m-%d' )
|
||||
and date_format( bc.create_time, '%Y-%m-%d' )
|
||||
BETWEEN date_format( #{beginTime}, '%Y-%m-%d' )
|
||||
and date_format( #{endTime}, '%Y-%m-%d' )
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY CASE WHEN sort IS NULL THEN 1 ELSE 0 END, sort
|
||||
</select>
|
||||
|
||||
<select id="selectListById" resultType="java.lang.Integer">
|
||||
<select id="selectListById" resultType="com.bonus.zlpt.home.pojo.BmCarouselSet">
|
||||
<include refid="selectBmCarouseVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -5,8 +5,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.zlpt.home.mapper.BmTopicInfoMapper">
|
||||
|
||||
<sql id="selectBmTopicVo">
|
||||
select id, topic_name, type, view_num, content, is_active, creator, create_time
|
||||
from bm_topic_info
|
||||
select id, topic_name, type, view_num, content, is_active, su.user_name AS creator, bt.create_time
|
||||
from bm_topic_info bt
|
||||
left join sys_user su on bt.creator = su.user_id
|
||||
</sql>
|
||||
|
||||
<insert id="insertConfig">
|
||||
|
|
@ -15,34 +16,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="type != null and type != '' ">type,</if>
|
||||
<if test="viewNum != null and viewNum != '' ">view_num,</if>
|
||||
<if test="content != null and content != '' ">content,</if>
|
||||
<if test="creator != null and creator != ''">creator,</if>
|
||||
create_time
|
||||
create_time,
|
||||
creator,
|
||||
is_active
|
||||
)values(
|
||||
<if test="topicName != null and topicName != ''">#{topicName},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="viewNum != null and viewNum != ''">#{openUrl},</if>
|
||||
<if test="viewNum != null and viewNum != ''">#{viewNum},</if>
|
||||
<if test="content != null and content != ''">#{content},</if>
|
||||
<if test="creator != null and creator != ''">#{creator},</if>
|
||||
sysdate()
|
||||
sysdate(),
|
||||
#{creator},
|
||||
1
|
||||
)
|
||||
</insert>
|
||||
|
||||
<update id="update">
|
||||
update bm_topic_info
|
||||
<set>
|
||||
<if test="id != null and id != ''">id = #{id},</if>
|
||||
<if test="topicName != null and topicName != ''">topic_name = #{topicName},</if>
|
||||
<if test="type != null and type != ''">type = #{type},</if>
|
||||
<if test="viewNum != null and viewNum != ''">view_num = #{viewNum},</if>
|
||||
<if test="content != null and content != ''">content = #{content},</if>
|
||||
</set>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteById">
|
||||
update bm_topic_info set is_active = '0' where id = #{id}
|
||||
</delete>
|
||||
|
||||
<select id="selectListById" resultType="java.lang.Integer">
|
||||
<select id="selectListById" resultType="com.bonus.zlpt.home.pojo.BmTopicInfo">
|
||||
<include refid="selectBmTopicVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
|
@ -54,7 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
AND topic_name like concat('%', #{topicName}, '%')
|
||||
</if>
|
||||
<if test="beginTime != null and beginTime != '' and endTime != null and endTime != ''">
|
||||
and date_format( create_time, '%Y-%m-%d' )
|
||||
and date_format( bt.create_time, '%Y-%m-%d' )
|
||||
BETWEEN date_format( #{beginTime}, '%Y-%m-%d' )
|
||||
and date_format( #{endTime}, '%Y-%m-%d' )
|
||||
</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue