站点搜索接口,图例管理,mybatis-plus连表插件整合,零碎修改等
This commit is contained in:
parent
b66357dd77
commit
04def663c1
@ -74,7 +74,7 @@ spring:
|
||||
# 服务模块
|
||||
devtools:
|
||||
restart:
|
||||
enabled: true # 热部署开关
|
||||
enabled: false # 热部署开关
|
||||
task:
|
||||
execution:
|
||||
pool:
|
||||
@ -103,7 +103,7 @@ user:
|
||||
token:
|
||||
header: Authorization # 令牌自定义标识
|
||||
secret: abcdefghijklfastbeesmartrstuvwxyz # 令牌密钥
|
||||
expireTime: 1440 # 令牌有效期(默认30分钟)1440为一天
|
||||
expireTime: 144000 # 令牌有效期(默认30分钟)1440为一天
|
||||
|
||||
# MyBatis配置
|
||||
#mybatis:
|
||||
@ -118,7 +118,7 @@ mybatis-plus:
|
||||
configLocation: classpath:mybatis/mybatis-config.xml # 加载全局的配置文件
|
||||
global-config:
|
||||
db-config:
|
||||
id-type: AUTO # 自增 ID
|
||||
id-type: ASSIGN_ID
|
||||
logic-delete-value: 1 # 逻辑已删除值(默认为 1)
|
||||
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE configuration
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-config.dtd">
|
||||
<configuration>
|
||||
<!-- 全局参数 -->
|
||||
<settings>
|
||||
@ -11,10 +11,10 @@ PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
|
||||
<setting name="useGeneratedKeys" value="true" />
|
||||
<!-- 配置默认的执行器.SIMPLE就是普通执行器;REUSE执行器会重用预处理语句(prepared statements);BATCH执行器将重用语句并执行批量更新 -->
|
||||
<setting name="defaultExecutorType" value="SIMPLE" />
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<!-- 指定 MyBatis 所用日志的具体实现 -->
|
||||
<setting name="logImpl" value="SLF4J" />
|
||||
<!-- 使用驼峰命名法转换字段 -->
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
</settings>
|
||||
|
||||
<!-- <setting name="mapUnderscoreToCamelCase" value="true"/> -->
|
||||
</settings>
|
||||
|
||||
</configuration>
|
||||
|
@ -45,6 +45,13 @@
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>${mybatis-plus-generator.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>${mybatis-plus-join.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
|
@ -104,6 +104,8 @@
|
||||
<artifactId>spring-session-data-redis</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
</project>
|
||||
|
@ -1,8 +1,11 @@
|
||||
package com.fastbee.framework.config;
|
||||
|
||||
import com.baomidou.mybatisplus.autoconfigure.SpringBootVFS;
|
||||
import com.baomidou.mybatisplus.core.config.GlobalConfig;
|
||||
import com.baomidou.mybatisplus.extension.spring.MybatisSqlSessionFactoryBean;
|
||||
import com.fastbee.common.utils.StringUtils;
|
||||
import com.github.yulichang.injector.MPJSqlInjector;
|
||||
import com.github.yulichang.interceptor.MPJInterceptor;
|
||||
import org.apache.ibatis.io.VFS;
|
||||
import org.apache.ibatis.session.SqlSessionFactory;
|
||||
import org.mybatis.spring.SqlSessionTemplate;
|
||||
@ -156,9 +159,12 @@ public class MyBatisConfig
|
||||
|
||||
final MybatisSqlSessionFactoryBean sessionFactory = new MybatisSqlSessionFactoryBean();
|
||||
sessionFactory.setDataSource(dataSource);
|
||||
|
||||
sessionFactory.setTypeAliasesPackage(typeAliasesPackage);
|
||||
sessionFactory.setMapperLocations(resolveMapperLocations(StringUtils.split(mapperLocations, ",")));
|
||||
sessionFactory.setConfigLocation(new DefaultResourceLoader().getResource(configLocation));
|
||||
sessionFactory.setGlobalConfig(new GlobalConfig().setSqlInjector(new MPJSqlInjector()));
|
||||
sessionFactory.setPlugins(new MPJInterceptor());
|
||||
return sessionFactory.getObject();
|
||||
}
|
||||
|
||||
|
@ -3,6 +3,7 @@ package com.fastbee.data.controller.gis;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.fastbee.ggroup.domain.dto.GLegendDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -47,22 +48,22 @@ public class GLegendController extends BaseController
|
||||
public TableDataInfo list(GLegend gLegend)
|
||||
{
|
||||
startPage();
|
||||
List<GLegend> list = gLegendService.selectGLegendList(gLegend);
|
||||
List<GLegendDto> list = gLegendService.selectGLegendList(gLegend);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出图例列表
|
||||
*/
|
||||
@ApiOperation("导出图例列表")
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:legend:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GLegend gLegend)
|
||||
{
|
||||
List<GLegend> list = gLegendService.selectGLegendList(gLegend);
|
||||
ExcelUtil<GLegend> util = new ExcelUtil<GLegend>(GLegend.class);
|
||||
util.exportExcel(response, list, "图例数据");
|
||||
}
|
||||
// @ApiOperation("导出图例列表")
|
||||
// @PreAuthorize("@ss.hasPermi('ggroup:legend:export')")
|
||||
// @PostMapping("/export")
|
||||
// public void export(HttpServletResponse response, GLegend gLegend)
|
||||
// {
|
||||
// List<GLegend> list = gLegendService.selectGLegendList(gLegend);
|
||||
// ExcelUtil<GLegend> util = new ExcelUtil<GLegend>(GLegend.class);
|
||||
// util.exportExcel(response, list, "图例数据");
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取图例详细信息
|
||||
|
@ -0,0 +1,110 @@
|
||||
package com.fastbee.data.controller.gis;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.fastbee.common.annotation.Log;
|
||||
import com.fastbee.common.core.controller.BaseController;
|
||||
import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.enums.BusinessType;
|
||||
import com.fastbee.ggroup.domain.GLegendType;
|
||||
import com.fastbee.ggroup.service.IGLegendTypeService;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 图例类型Controller
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-09
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/gis/legend/type")
|
||||
@Api(tags = "图例类型")
|
||||
public class GLegendTypeController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IGLegendTypeService gLegendTypeService;
|
||||
|
||||
/**
|
||||
* 查询图例类型列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:list')")
|
||||
@GetMapping("/list")
|
||||
@ApiOperation("查询图例类型列表")
|
||||
public TableDataInfo list(GLegendType gLegendType)
|
||||
{
|
||||
startPage();
|
||||
List<GLegendType> list = gLegendTypeService.selectGLegendTypeList(gLegendType);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出图例类型列表
|
||||
*/
|
||||
@ApiOperation("导出图例类型列表")
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:export')")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, GLegendType gLegendType)
|
||||
{
|
||||
List<GLegendType> list = gLegendTypeService.selectGLegendTypeList(gLegendType);
|
||||
ExcelUtil<GLegendType> util = new ExcelUtil<GLegendType>(GLegendType.class);
|
||||
util.exportExcel(response, list, "图例类型数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取图例类型详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:query')")
|
||||
@GetMapping(value = "/{id}")
|
||||
@ApiOperation("获取图例类型详细信息")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(gLegendTypeService.selectGLegendTypeById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图例类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增图例类型")
|
||||
public AjaxResult add(@RequestBody GLegendType gLegendType)
|
||||
{
|
||||
return toAjax(gLegendTypeService.insertGLegendType(gLegendType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图例类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:edit')")
|
||||
@PutMapping
|
||||
@ApiOperation("修改图例类型")
|
||||
public AjaxResult edit(@RequestBody GLegendType gLegendType)
|
||||
{
|
||||
return toAjax(gLegendTypeService.updateGLegendType(gLegendType));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图例类型
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:type:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@ApiOperation("删除图例类型")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(gLegendTypeService.deleteGLegendTypeByIds(ids));
|
||||
}
|
||||
}
|
@ -131,4 +131,20 @@ public class GSitesController extends BaseController
|
||||
{
|
||||
return toAjax(gSitesService.deleteGSitesByIds(ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:sites:search')")
|
||||
@GetMapping("/search")
|
||||
@ApiOperation("搜索站点")
|
||||
public TableDataInfo search(GSites gSites){
|
||||
startPage();
|
||||
List<GSites> list = gSitesService.searchGSitesList(gSites);
|
||||
return getDataTable(list);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,41 @@
|
||||
package com.fastbee.ggroup.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import com.fastbee.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 图例类型对象 g_legend_type
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-09
|
||||
*/
|
||||
@ApiModel(value = "GLegendType",description = "图例类型 g_legend_type")
|
||||
@Data
|
||||
public class GLegendType extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
|
||||
/** 图例类型名称 */
|
||||
@Excel(name = "图例类型名称")
|
||||
@ApiModelProperty("图例类型名称")
|
||||
private String typeName;
|
||||
|
||||
/** 图例类型描述 */
|
||||
@Excel(name = "图例类型描述")
|
||||
@ApiModelProperty("图例类型描述")
|
||||
private String description;
|
||||
|
||||
/** 类别 */
|
||||
@Excel(name = "类别")
|
||||
@ApiModelProperty("类别")
|
||||
private String category;
|
||||
|
||||
}
|
@ -0,0 +1,24 @@
|
||||
package com.fastbee.ggroup.domain.dto;
|
||||
|
||||
import com.fastbee.common.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GLegendDto {
|
||||
|
||||
/** 主键id */
|
||||
private Long id;
|
||||
/** 图标 */
|
||||
private String icon;
|
||||
/** 类型 */
|
||||
private Long type;
|
||||
/** 图标名称 */
|
||||
private String name;
|
||||
/** 项目id */
|
||||
private Long projectId;
|
||||
/** 图例类型名称 */
|
||||
private String typeName;
|
||||
/** 类别 */
|
||||
private String category;
|
||||
}
|
@ -2,6 +2,7 @@ package com.fastbee.ggroup.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.ggroup.domain.GLegend;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 图例Mapper接口
|
||||
@ -9,7 +10,7 @@ import com.fastbee.ggroup.domain.GLegend;
|
||||
* @author kerwincui
|
||||
* @date 2024-10-08
|
||||
*/
|
||||
public interface GLegendMapper
|
||||
public interface GLegendMapper extends MPJBaseMapper<GLegend>
|
||||
{
|
||||
/**
|
||||
* 查询图例
|
||||
|
@ -0,0 +1,62 @@
|
||||
package com.fastbee.ggroup.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.ggroup.domain.GLegendType;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
|
||||
/**
|
||||
* 图例类型Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-09
|
||||
*/
|
||||
public interface GLegendTypeMapper extends MPJBaseMapper<GLegendType>
|
||||
{
|
||||
/**
|
||||
* 查询图例类型
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 图例类型
|
||||
*/
|
||||
public GLegendType selectGLegendTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询图例类型列表
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 图例类型集合
|
||||
*/
|
||||
public List<GLegendType> selectGLegendTypeList(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 新增图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGLegendType(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 修改图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGLegendType(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 删除图例类型
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGLegendTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除图例类型
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGLegendTypeByIds(Long[] ids);
|
||||
}
|
@ -2,10 +2,9 @@ package com.fastbee.ggroup.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.ggroup.domain.GSites;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSiteDto;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import com.github.yulichang.base.MPJBaseMapper;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
@ -15,7 +14,7 @@ import org.apache.ibatis.annotations.Param;
|
||||
* @author kerwincui
|
||||
* @date 2024-09-29
|
||||
*/
|
||||
public interface GSitesMapper extends BaseMapper<GSites>
|
||||
public interface GSitesMapper extends MPJBaseMapper<GSites>
|
||||
{
|
||||
/**
|
||||
* 查询站点
|
||||
|
@ -2,6 +2,7 @@ package com.fastbee.ggroup.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.ggroup.domain.GLegend;
|
||||
import com.fastbee.ggroup.domain.dto.GLegendDto;
|
||||
|
||||
/**
|
||||
* 图例Service接口
|
||||
@ -25,7 +26,7 @@ public interface IGLegendService
|
||||
* @param gLegend 图例
|
||||
* @return 图例集合
|
||||
*/
|
||||
public List<GLegend> selectGLegendList(GLegend gLegend);
|
||||
public List<GLegendDto> selectGLegendList(GLegend gLegend);
|
||||
|
||||
/**
|
||||
* 新增图例
|
||||
|
@ -0,0 +1,61 @@
|
||||
package com.fastbee.ggroup.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.ggroup.domain.GLegendType;
|
||||
|
||||
/**
|
||||
* 图例类型Service接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-09
|
||||
*/
|
||||
public interface IGLegendTypeService
|
||||
{
|
||||
/**
|
||||
* 查询图例类型
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 图例类型
|
||||
*/
|
||||
public GLegendType selectGLegendTypeById(Long id);
|
||||
|
||||
/**
|
||||
* 查询图例类型列表
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 图例类型集合
|
||||
*/
|
||||
public List<GLegendType> selectGLegendTypeList(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 新增图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGLegendType(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 修改图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGLegendType(GLegendType gLegendType);
|
||||
|
||||
/**
|
||||
* 批量删除图例类型
|
||||
*
|
||||
* @param ids 需要删除的图例类型主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGLegendTypeByIds(Long[] ids);
|
||||
|
||||
/**
|
||||
* 删除图例类型信息
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGLegendTypeById(Long id);
|
||||
}
|
@ -41,7 +41,7 @@ public interface IGSitesService
|
||||
/**
|
||||
* 修改站点
|
||||
*
|
||||
* @param gSites 站点
|
||||
* @param gSitesEditDto 站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGSites(GSitesEditDto gSitesEditDto);
|
||||
@ -69,4 +69,6 @@ public interface IGSitesService
|
||||
* @return
|
||||
*/
|
||||
int relateGroup(GGroupSiteRelateDto gGroupSiteRelateDto);
|
||||
|
||||
List<GSites> searchGSitesList(GSites gSites);
|
||||
}
|
||||
|
@ -2,6 +2,10 @@ package com.fastbee.ggroup.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.ggroup.domain.GLegendType;
|
||||
import com.fastbee.ggroup.domain.dto.GLegendDto;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.ggroup.mapper.GLegendMapper;
|
||||
@ -39,9 +43,16 @@ public class GLegendServiceImpl implements IGLegendService
|
||||
* @return 图例
|
||||
*/
|
||||
@Override
|
||||
public List<GLegend> selectGLegendList(GLegend gLegend)
|
||||
public List<GLegendDto> selectGLegendList(GLegend gLegend)
|
||||
{
|
||||
return gLegendMapper.selectGLegendList(gLegend);
|
||||
|
||||
MPJLambdaWrapper<GLegend> wrapper = new MPJLambdaWrapper<GLegend>()
|
||||
.select(GLegend::getId,GLegend::getIcon,GLegend::getType,GLegend::getName)
|
||||
.select(GLegendType::getTypeName,GLegendType::getCategory)
|
||||
.leftJoin(GLegendType.class,GLegendType::getId,GLegend::getType);
|
||||
|
||||
return gLegendMapper.selectJoinList(GLegendDto.class,wrapper);
|
||||
// return gLegendMapper.selectGLegendList(gLegend);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -0,0 +1,96 @@
|
||||
package com.fastbee.ggroup.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.ggroup.mapper.GLegendTypeMapper;
|
||||
import com.fastbee.ggroup.domain.GLegendType;
|
||||
import com.fastbee.ggroup.service.IGLegendTypeService;
|
||||
|
||||
/**
|
||||
* 图例类型Service业务层处理
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-10-09
|
||||
*/
|
||||
@Service
|
||||
public class GLegendTypeServiceImpl implements IGLegendTypeService
|
||||
{
|
||||
@Autowired
|
||||
private GLegendTypeMapper gLegendTypeMapper;
|
||||
|
||||
/**
|
||||
* 查询图例类型
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 图例类型
|
||||
*/
|
||||
@Override
|
||||
public GLegendType selectGLegendTypeById(Long id)
|
||||
{
|
||||
return gLegendTypeMapper.selectGLegendTypeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询图例类型列表
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 图例类型
|
||||
*/
|
||||
@Override
|
||||
public List<GLegendType> selectGLegendTypeList(GLegendType gLegendType)
|
||||
{
|
||||
return gLegendTypeMapper.selectGLegendTypeList(gLegendType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGLegendType(GLegendType gLegendType)
|
||||
{
|
||||
gLegendType.setCreateTime(DateUtils.getNowDate());
|
||||
return gLegendTypeMapper.insertGLegendType(gLegendType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改图例类型
|
||||
*
|
||||
* @param gLegendType 图例类型
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateGLegendType(GLegendType gLegendType)
|
||||
{
|
||||
gLegendType.setUpdateTime(DateUtils.getNowDate());
|
||||
return gLegendTypeMapper.updateGLegendType(gLegendType);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除图例类型
|
||||
*
|
||||
* @param ids 需要删除的图例类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGLegendTypeByIds(Long[] ids)
|
||||
{
|
||||
return gLegendTypeMapper.deleteGLegendTypeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除图例类型信息
|
||||
*
|
||||
* @param id 图例类型主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteGLegendTypeById(Long id)
|
||||
{
|
||||
return gLegendTypeMapper.deleteGLegendTypeById(id);
|
||||
}
|
||||
}
|
@ -13,6 +13,8 @@ import com.fastbee.ggroup.domain.dto.GGroupSiteRelateDto;
|
||||
import com.fastbee.ggroup.domain.dto.GSitesEditDto;
|
||||
import com.fastbee.ggroup.mapper.GSiteGroupsMapper;
|
||||
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -55,6 +57,7 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
||||
*/
|
||||
@Override
|
||||
public List<GSites> selectGSitesList(GSites gSites) {
|
||||
|
||||
return gSitesMapper.selectList(new LambdaQueryWrapper<GSites>()
|
||||
.select(GSites::getId, GSites::getName, GSites::getIcon, GSites::getType)
|
||||
.eq(GSites::getProjectId, 1)
|
||||
@ -108,7 +111,6 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
||||
if(gSites.getName().trim().equals(gSitesEditDto.getName().trim())){
|
||||
return 1;
|
||||
}
|
||||
|
||||
//不能有重复名字的站点
|
||||
GSites gSites1 = gSitesMapper.selectOne(new LambdaQueryWrapper<GSites>()
|
||||
.select(GSites::getName, GSites::getId)
|
||||
@ -151,6 +153,7 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
||||
return gSiteGroupsMapper.deleteById(id);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int relateGroup(GGroupSiteRelateDto gGroupSiteRelateDto) {
|
||||
Long parentId = gGroupSiteRelateDto.getParentId();
|
||||
@ -175,6 +178,14 @@ public class GSitesServiceImpl extends ServiceImpl<GSiteGroupsMapper,GSiteGroups
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GSites> searchGSitesList(GSites gSites) {
|
||||
return gSitesMapper.selectList(new LambdaQueryWrapper<GSites>()
|
||||
.eq(GSites::getProjectId, gSites.getProjectId())
|
||||
.select(GSites::getId, GSites::getName, GSites::getType, GSites::getIcon)
|
||||
.like(GSites::getName, gSites.getSearchValue()));
|
||||
}
|
||||
|
||||
private GSiteGroups setSiteIdToSiteGroups(Long siteId) {
|
||||
GSiteGroups gSiteGroups = new GSiteGroups();
|
||||
gSiteGroups.setSiteId(siteId);
|
||||
|
@ -0,0 +1,82 @@
|
||||
<?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.fastbee.ggroup.mapper.GLegendTypeMapper">
|
||||
|
||||
<resultMap type="GLegendType" id="GLegendTypeResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="typeName" column="type_name" />
|
||||
<result property="description" column="description" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="category" column="category" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGLegendTypeVo">
|
||||
select id, type_name, description, create_time, create_by, update_time, update_by, category from g_legend_type
|
||||
</sql>
|
||||
|
||||
<select id="selectGLegendTypeList" parameterType="GLegendType" resultMap="GLegendTypeResult">
|
||||
<include refid="selectGLegendTypeVo"/>
|
||||
<where>
|
||||
<if test="typeName != null and typeName != ''"> and type_name like concat('%', #{typeName}, '%')</if>
|
||||
<if test="description != null and description != ''"> and description = #{description}</if>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGLegendTypeById" parameterType="Long" resultMap="GLegendTypeResult">
|
||||
<include refid="selectGLegendTypeVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertGLegendType" parameterType="GLegendType" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into g_legend_type
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">type_name,</if>
|
||||
<if test="description != null">description,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="category != null">category,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">#{typeName},</if>
|
||||
<if test="description != null">#{description},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGLegendType" parameterType="GLegendType">
|
||||
update g_legend_type
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="typeName != null and typeName != ''">type_name = #{typeName},</if>
|
||||
<if test="description != null">description = #{description},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGLegendTypeById" parameterType="Long">
|
||||
delete from g_legend_type where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGLegendTypeByIds" parameterType="String">
|
||||
delete from g_legend_type where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
7
pom.xml
7
pom.xml
@ -41,6 +41,7 @@
|
||||
<mapstruct.version>1.5.5.Final</mapstruct.version>
|
||||
<mybatis-plus.version>3.5.3.1</mybatis-plus.version>
|
||||
<mybatis-plus-generator.version>3.5.3.1</mybatis-plus-generator.version>
|
||||
<mybatis-plus-join.version>1.5.0</mybatis-plus-join.version>
|
||||
<guava.version>32.0.1-jre</guava.version>
|
||||
<easyexcel.version>3.3.1</easyexcel.version>
|
||||
<liteflow.version>2.12.2</liteflow.version>
|
||||
@ -94,6 +95,12 @@
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>${mybatis-plus-generator.version}</version>
|
||||
</dependency>
|
||||
<!-- mybatis plus join -->
|
||||
<dependency>
|
||||
<groupId>com.github.yulichang</groupId>
|
||||
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||
<version>${mybatis-plus-join.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!-- pagehelper 分页插件 -->
|
||||
<dependency>
|
||||
|
Loading…
x
Reference in New Issue
Block a user