gis组管理,站点管理相关接口完成
This commit is contained in:
parent
53097c8cf6
commit
237da90701
@ -5,7 +5,8 @@ import com.fastbee.common.core.domain.AjaxResult;
|
||||
import com.fastbee.common.core.page.TableDataInfo;
|
||||
import com.fastbee.common.utils.poi.ExcelUtil;
|
||||
import com.fastbee.ggroup.domain.GGroups;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSite;
|
||||
import com.fastbee.ggroup.domain.vo.GGroupSiteVo;
|
||||
import com.fastbee.ggroup.enums.GroupTagEnum;
|
||||
import com.fastbee.ggroup.service.IGGroupsService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@ -14,7 +15,9 @@ import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.*;
|
||||
|
||||
import static java.util.stream.Collectors.toList;
|
||||
|
||||
/**
|
||||
* 组Controller
|
||||
@ -50,11 +53,32 @@ public class GGroupsController extends BaseController
|
||||
public TableDataInfo listSite(GGroups gGroups)
|
||||
{
|
||||
super.startPage();
|
||||
List<GGroupSite> list = gGroupsService.selectGGroupsListSites(gGroups);
|
||||
List<GGroupSiteVo> list = gGroupsService.selectGGroupsListSites(gGroups);
|
||||
list.forEach(System.err::println);
|
||||
return super.getDataTable(list);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取组的标签(类别)
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('iot:groups:list')")
|
||||
@GetMapping("/list-label")
|
||||
@ApiOperation("获取组的标签(类别)")
|
||||
public AjaxResult listLabel() {
|
||||
// 使用传统的方式将枚举转换为列表
|
||||
List<Map<String, Object>> labelList = new ArrayList<>();
|
||||
|
||||
for (GroupTagEnum tag : GroupTagEnum.values()) {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put("code", tag.getCode());
|
||||
map.put("value", tag.getDescription());
|
||||
labelList.add(map);
|
||||
}
|
||||
|
||||
return AjaxResult.success(labelList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出组列表
|
||||
*/
|
||||
|
@ -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.GGroupSiteDto;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@ -81,9 +82,9 @@ public class GSitesController extends BaseController
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:sites:add')")
|
||||
@PostMapping
|
||||
@ApiOperation("新增站点")
|
||||
public AjaxResult add(@RequestBody GSites gSites)
|
||||
public AjaxResult add(@RequestBody GGroupSiteDto gGroupSiteDto)
|
||||
{
|
||||
return toAjax(gSitesService.insertGSites(gSites));
|
||||
return toAjax(gSitesService.insertGSites(gGroupSiteDto));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -97,11 +98,22 @@ public class GSitesController extends BaseController
|
||||
return toAjax(gSitesService.updateGSites(gSites));
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据id删除站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:sites:remove')")
|
||||
@DeleteMapping("/{id}")
|
||||
@ApiOperation("根据id删除站点")
|
||||
public AjaxResult remove(@PathVariable Long id){
|
||||
return toAjax(gSitesService.deleteGSitesById(id));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 删除站点
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('ggroup:sites:remove')")
|
||||
@DeleteMapping("/{ids}")
|
||||
@DeleteMapping("/batch/{ids}")
|
||||
@ApiOperation("删除站点")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
|
@ -0,0 +1,48 @@
|
||||
package com.fastbee.ggroup.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
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_site_groups
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-09-30
|
||||
*/
|
||||
@ApiModel(value = "GSiteGroups",description = "站点组关系 g_site_groups")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class GSiteGroups extends BaseEntity
|
||||
{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
private Long id;
|
||||
|
||||
/** 站点id */
|
||||
@Excel(name = "站点id")
|
||||
@ApiModelProperty("站点id")
|
||||
private Long siteId;
|
||||
|
||||
/** 组id(关联表g_group的id) */
|
||||
@Excel(name = "组id(关联表g_group的id)")
|
||||
@ApiModelProperty("组id(关联表g_group的id)")
|
||||
private Long parentId;
|
||||
|
||||
/** 项目id */
|
||||
@Excel(name = "项目id")
|
||||
@ApiModelProperty("项目id")
|
||||
private Long projectId;
|
||||
|
||||
/** 排序 */
|
||||
@Excel(name = "排序")
|
||||
@ApiModelProperty("排序")
|
||||
private Long orderNum;
|
||||
|
||||
}
|
@ -1,7 +1,10 @@
|
||||
package com.fastbee.ggroup.domain;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
@ -23,6 +26,7 @@ public class GSites extends BaseEntity
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 主键 */
|
||||
@TableId(value = "id", type = IdType.AUTO)
|
||||
private Long id;
|
||||
|
||||
/** 站点名称 */
|
||||
|
@ -0,0 +1,17 @@
|
||||
package com.fastbee.ggroup.domain.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GGroupSiteDto {
|
||||
private Long parentId; // 父节点id
|
||||
private String parentName; // 父节点名称
|
||||
private Long siteId; // 站点id
|
||||
private String name; // 站点名称
|
||||
private String icon; // 站点图标
|
||||
private String type; // 站点类型
|
||||
private String space; // 站点空间
|
||||
private Integer orderNum;// 排序
|
||||
private Long projectId;//项目id
|
||||
|
||||
}
|
@ -1,9 +1,10 @@
|
||||
package com.fastbee.ggroup.domain.dto;
|
||||
package com.fastbee.ggroup.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class GGroupSite {
|
||||
public class GGroupSiteVo {
|
||||
private Long id; // 对应 gsg.id
|
||||
private Long parentId; // 对应 gsg.group_id
|
||||
private String parentName; // 对应 gg.name
|
||||
private Long siteId; // 对应 gsg.site_id
|
||||
@ -11,6 +12,5 @@ public class GGroupSite {
|
||||
private String icon; // 对应 gs.icon
|
||||
private String type; // 对应 gs.type
|
||||
private String space; // 对应 gs.space
|
||||
|
||||
// Getter 和 Setter
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.fastbee.ggroup.enums;
|
||||
|
||||
public enum GroupTagEnum {
|
||||
RIVERS_LAKES(1, "江河湖泊"),
|
||||
WATER_CONSERVANCY_PROJECTS(2, "水利工程"),
|
||||
MONITORING_STATIONS(3, "检测站点"),
|
||||
OTHER_OBJECTS(4, "其他对象"),
|
||||
WATER_AFFAIRS(5, "水利事务"),
|
||||
ALARM_EVENTS(6, "报警事件");
|
||||
|
||||
private final int code;
|
||||
private final String description;
|
||||
|
||||
GroupTagEnum(int code, String description) {
|
||||
this.code = code;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public int getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public static GroupTagEnum fromCode(int code) {
|
||||
for (GroupTagEnum tag : GroupTagEnum.values()) {
|
||||
if (tag.getCode() == code) {
|
||||
return tag;
|
||||
}
|
||||
}
|
||||
throw new IllegalArgumentException("No tag found with code: " + code);
|
||||
}
|
||||
}
|
@ -3,7 +3,7 @@ package com.fastbee.ggroup.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.ggroup.domain.GGroups;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSite;
|
||||
import com.fastbee.ggroup.domain.vo.GGroupSiteVo;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
@ -36,7 +36,7 @@ public interface GGroupsMapper extends BaseMapper<GGroups>
|
||||
|
||||
@Select({
|
||||
"<script>",
|
||||
"select gsg.parent_id as parent_id, gg.name as parent_name, gsg.site_id as siteId, gs.name as name, gs.icon, gs.type, gs.space",
|
||||
"select gsg.id ,gsg.parent_id as parent_id, gg.name as parent_name, gsg.site_id as siteId, gs.name as name, gs.icon, gs.type, gs.space",
|
||||
"from g_site_groups gsg",
|
||||
"left join g_groups gg on gsg.parent_id = gg.id",
|
||||
"left join g_sites gs on gsg.site_id = gs.id",
|
||||
@ -49,7 +49,7 @@ public interface GGroupsMapper extends BaseMapper<GGroups>
|
||||
"</if>",
|
||||
"</script>"
|
||||
})
|
||||
List<GGroupSite> selectGGroupsSiteList(GGroups gGroups);
|
||||
List<GGroupSiteVo> selectGGroupsSiteList(GGroups gGroups);
|
||||
|
||||
/**
|
||||
* 新增组
|
||||
|
@ -0,0 +1,63 @@
|
||||
package com.fastbee.ggroup.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.fastbee.ggroup.domain.GSiteGroups;
|
||||
|
||||
/**
|
||||
* 站点组关系Mapper接口
|
||||
*
|
||||
* @author kerwincui
|
||||
* @date 2024-09-30
|
||||
*/
|
||||
public interface GSiteGroupsMapper extends BaseMapper<GSiteGroups>
|
||||
{
|
||||
/**
|
||||
* 查询站点组关系
|
||||
*
|
||||
* @param id 站点组关系主键
|
||||
* @return 站点组关系
|
||||
*/
|
||||
public GSiteGroups selectGSiteGroupsById(Long id);
|
||||
|
||||
/**
|
||||
* 查询站点组关系列表
|
||||
*
|
||||
* @param gSiteGroups 站点组关系
|
||||
* @return 站点组关系集合
|
||||
*/
|
||||
public List<GSiteGroups> selectGSiteGroupsList(GSiteGroups gSiteGroups);
|
||||
|
||||
/**
|
||||
* 新增站点组关系
|
||||
*
|
||||
* @param gSiteGroups 站点组关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGSiteGroups(GSiteGroups gSiteGroups);
|
||||
|
||||
/**
|
||||
* 修改站点组关系
|
||||
*
|
||||
* @param gSiteGroups 站点组关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateGSiteGroups(GSiteGroups gSiteGroups);
|
||||
|
||||
/**
|
||||
* 删除站点组关系
|
||||
*
|
||||
* @param id 站点组关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGSiteGroupsById(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点组关系
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGSiteGroupsByIds(Long[] ids);
|
||||
}
|
@ -1,7 +1,13 @@
|
||||
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 org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 站点Mapper接口
|
||||
@ -9,7 +15,7 @@ import com.fastbee.ggroup.domain.GSites;
|
||||
* @author kerwincui
|
||||
* @date 2024-09-29
|
||||
*/
|
||||
public interface GSitesMapper
|
||||
public interface GSitesMapper extends BaseMapper<GSites>
|
||||
{
|
||||
/**
|
||||
* 查询站点
|
||||
@ -30,10 +36,12 @@ public interface GSitesMapper
|
||||
/**
|
||||
* 新增站点
|
||||
*
|
||||
* @param gSites 站点
|
||||
* @param gGroupSiteDto 站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGSites(GSites gSites);
|
||||
@Insert("insert into g_site_groups (site_id, parent_id, project_id,order_num) " +
|
||||
"value (#{siteId},#{parentId},#{projectId},#{orderNum})")
|
||||
public int insertGSites(GGroupSiteDto gGroupSiteDto);
|
||||
|
||||
/**
|
||||
* 修改站点
|
||||
@ -49,7 +57,9 @@ public interface GSitesMapper
|
||||
* @param id 站点主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteGSitesById(Long id);
|
||||
|
||||
// @Delete("delete from g_site_groups where id= #{id}")
|
||||
public int deleteGSitesById(@Param("id") Long id);
|
||||
|
||||
/**
|
||||
* 批量删除站点
|
||||
|
@ -4,7 +4,7 @@ package com.fastbee.ggroup.service;
|
||||
|
||||
|
||||
import com.fastbee.ggroup.domain.GGroups;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSite;
|
||||
import com.fastbee.ggroup.domain.vo.GGroupSiteVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@ -32,7 +32,7 @@ public interface IGGroupsService
|
||||
*/
|
||||
public List<GGroups> selectGGroupsList(GGroups gGroups);
|
||||
|
||||
public List<GGroupSite> selectGGroupsListSites(GGroups gGroups);
|
||||
public List<GGroupSiteVo> selectGGroupsListSites(GGroups gGroups);
|
||||
/**
|
||||
* 新增组
|
||||
*
|
||||
|
@ -2,6 +2,7 @@ package com.fastbee.ggroup.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.ggroup.domain.GSites;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSiteDto;
|
||||
|
||||
/**
|
||||
* 站点Service接口
|
||||
@ -30,10 +31,10 @@ public interface IGSitesService
|
||||
/**
|
||||
* 新增站点
|
||||
*
|
||||
* @param gSites 站点
|
||||
* @param gGroupSiteDto 站点
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertGSites(GSites gSites);
|
||||
public int insertGSites(GGroupSiteDto gGroupSiteDto);
|
||||
|
||||
/**
|
||||
* 修改站点
|
||||
|
@ -3,7 +3,7 @@ package com.fastbee.ggroup.service.impl;
|
||||
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.ggroup.domain.GGroups;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSite;
|
||||
import com.fastbee.ggroup.domain.vo.GGroupSiteVo;
|
||||
import com.fastbee.ggroup.mapper.GGroupsMapper;
|
||||
import com.fastbee.ggroup.service.IGGroupsService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@ -57,7 +57,7 @@ public class GGroupsServiceImpl implements IGGroupsService
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<GGroupSite> selectGGroupsListSites(GGroups gGroups) {
|
||||
public List<GGroupSiteVo> selectGGroupsListSites(GGroups gGroups) {
|
||||
return gGroupsMapper.selectGGroupsSiteList(gGroups);
|
||||
}
|
||||
|
||||
|
@ -2,11 +2,15 @@ package com.fastbee.ggroup.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.fastbee.common.utils.DateUtils;
|
||||
import com.fastbee.ggroup.domain.GSiteGroups;
|
||||
import com.fastbee.ggroup.domain.dto.GGroupSiteDto;
|
||||
import com.fastbee.ggroup.mapper.GSiteGroupsMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.fastbee.ggroup.mapper.GSitesMapper;
|
||||
import com.fastbee.ggroup.domain.GSites;
|
||||
import com.fastbee.ggroup.service.IGSitesService;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
/**
|
||||
* 站点Service业务层处理
|
||||
@ -20,6 +24,9 @@ public class GSitesServiceImpl implements IGSitesService
|
||||
@Autowired
|
||||
private GSitesMapper gSitesMapper;
|
||||
|
||||
@Autowired
|
||||
private GSiteGroupsMapper gSiteGroupsMapper;
|
||||
|
||||
/**
|
||||
* 查询站点
|
||||
*
|
||||
@ -47,14 +54,22 @@ public class GSitesServiceImpl implements IGSitesService
|
||||
/**
|
||||
* 新增站点
|
||||
*
|
||||
* @param gSites 站点
|
||||
* @param gGroupSiteDto 站点
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertGSites(GSites gSites)
|
||||
{
|
||||
gSites.setCreateTime(DateUtils.getNowDate());
|
||||
return gSitesMapper.insertGSites(gSites);
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int insertGSites(GGroupSiteDto gGroupSiteDto)
|
||||
{ //更新关系表
|
||||
GSites gSites = new GSites();
|
||||
gSites.setName(gGroupSiteDto.getName());
|
||||
gSites.setType(gGroupSiteDto.getType());
|
||||
gSites.setIcon(gGroupSiteDto.getIcon());
|
||||
|
||||
int inserted = gSitesMapper.insert(gSites);
|
||||
gGroupSiteDto.setSiteId(gSites.getId());
|
||||
int inserted1 = gSitesMapper.insertGSites(gGroupSiteDto);
|
||||
return inserted==1&&inserted1==1?1:0 ;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -67,7 +82,7 @@ public class GSitesServiceImpl implements IGSitesService
|
||||
public int updateGSites(GSites gSites)
|
||||
{
|
||||
gSites.setUpdateTime(DateUtils.getNowDate());
|
||||
return gSitesMapper.updateGSites(gSites);
|
||||
return gSitesMapper.updateById(gSites);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -89,8 +104,16 @@ public class GSitesServiceImpl implements IGSitesService
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public int deleteGSitesById(Long id)
|
||||
{
|
||||
return gSitesMapper.deleteGSitesById(id);
|
||||
GSiteGroups gSiteGroups =gSiteGroupsMapper.selectGSiteGroupsById(id);
|
||||
if(gSiteGroups==null){
|
||||
throw new RuntimeException("站点不存在");
|
||||
}
|
||||
int deleted= gSitesMapper.deleteById(gSiteGroups.getId());
|
||||
//删除关系
|
||||
int deleted1=gSiteGroupsMapper.deleteById(id);
|
||||
return deleted==1&&deleted1==1?1:0 ;
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
<result property="space" column="space" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="GGroupsSiteResult" type="GGroupSite" >
|
||||
<resultMap id="GGroupsSiteResult" type="GGroupSiteDto" >
|
||||
<result property="parentId" column="group_id" />
|
||||
<result property="parentName" column="group_name" />
|
||||
<result property="siteId" column="id" />
|
||||
|
@ -0,0 +1,87 @@
|
||||
<?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.GSiteGroupsMapper">
|
||||
|
||||
<resultMap type="GSiteGroups" id="GSiteGroupsResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="siteId" column="site_id" />
|
||||
<result property="parentId" column="parent_id" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="projectId" column="project_id" />
|
||||
<result property="orderNum" column="order_num" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectGSiteGroupsVo">
|
||||
select id, site_id, parent_id, create_by, create_time, update_time, update_by, project_id, order_num from g_site_groups
|
||||
</sql>
|
||||
|
||||
<select id="selectGSiteGroupsList" parameterType="GSiteGroups" resultMap="GSiteGroupsResult">
|
||||
<include refid="selectGSiteGroupsVo"/>
|
||||
<where>
|
||||
<if test="siteId != null "> and site_id = #{siteId}</if>
|
||||
<if test="parentId != null "> and parent_id = #{parentId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="orderNum != null "> and order_num = #{orderNum}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectGSiteGroupsById" parameterType="Long" resultMap="GSiteGroupsResult">
|
||||
<include refid="selectGSiteGroupsVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertGSiteGroups" parameterType="GSiteGroups" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into g_site_groups
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id,</if>
|
||||
<if test="parentId != null">parent_id,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="projectId != null">project_id,</if>
|
||||
<if test="orderNum != null">order_num,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="siteId != null">#{siteId},</if>
|
||||
<if test="parentId != null">#{parentId},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="projectId != null">#{projectId},</if>
|
||||
<if test="orderNum != null">#{orderNum},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateGSiteGroups" parameterType="GSiteGroups">
|
||||
update g_site_groups
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="siteId != null">site_id = #{siteId},</if>
|
||||
<if test="parentId != null">parent_id = #{parentId},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="projectId != null">project_id = #{projectId},</if>
|
||||
<if test="orderNum != null">order_num = #{orderNum},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteGSiteGroupsById" parameterType="Long">
|
||||
delete from g_site_groups where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGSiteGroupsByIds" parameterType="String">
|
||||
delete from g_site_groups where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -35,29 +35,29 @@
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertGSites" parameterType="GSites" useGeneratedKeys="true" keyProperty="id">
|
||||
insert into g_sites
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">name,</if>
|
||||
<if test="icon != null">icon,</if>
|
||||
<if test="type != null">type,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="space != null">space,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null and name != ''">#{name},</if>
|
||||
<if test="icon != null">#{icon},</if>
|
||||
<if test="type != null">#{type},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="space != null">#{space},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
<!-- <insert id="insertGSites" parameterType="GSites" useGeneratedKeys="true" keyProperty="id">-->
|
||||
<!-- insert into g_sites-->
|
||||
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="name != null and name != ''">name,</if>-->
|
||||
<!-- <if test="icon != null">icon,</if>-->
|
||||
<!-- <if test="type != null">type,</if>-->
|
||||
<!-- <if test="createBy != null">create_by,</if>-->
|
||||
<!-- <if test="createTime != null">create_time,</if>-->
|
||||
<!-- <if test="updateTime != null">update_time,</if>-->
|
||||
<!-- <if test="updateBy != null">update_by,</if>-->
|
||||
<!-- <if test="space != null">space,</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- <trim prefix="values (" suffix=")" suffixOverrides=",">-->
|
||||
<!-- <if test="name != null and name != ''">#{name},</if>-->
|
||||
<!-- <if test="icon != null">#{icon},</if>-->
|
||||
<!-- <if test="type != null">#{type},</if>-->
|
||||
<!-- <if test="createBy != null">#{createBy},</if>-->
|
||||
<!-- <if test="createTime != null">#{createTime},</if>-->
|
||||
<!-- <if test="updateTime != null">#{updateTime},</if>-->
|
||||
<!-- <if test="updateBy != null">#{updateBy},</if>-->
|
||||
<!-- <if test="space != null">#{space},</if>-->
|
||||
<!-- </trim>-->
|
||||
<!-- </insert>-->
|
||||
|
||||
<update id="updateGSites" parameterType="GSites">
|
||||
update g_sites
|
||||
@ -75,7 +75,7 @@
|
||||
</update>
|
||||
|
||||
<delete id="deleteGSitesById" parameterType="Long">
|
||||
delete from g_sites where id = #{id}
|
||||
delete from g_site_groups where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteGSitesByIds" parameterType="String">
|
||||
|
Loading…
x
Reference in New Issue
Block a user