feat:增加新接口
This commit is contained in:
parent
43c4b027bc
commit
cc559f4cb1
|
|
@ -62,6 +62,8 @@ public class AirlineAreaGroupController extends BaseController {
|
||||||
@Operation(summary = "新增分组")
|
@Operation(summary = "新增分组")
|
||||||
public AjaxResult add(@Validated @RequestBody AirlineAreaGroupVO group) {
|
public AjaxResult add(@Validated @RequestBody AirlineAreaGroupVO group) {
|
||||||
group.setUserId(SecurityUtils.getUserId());
|
group.setUserId(SecurityUtils.getUserId());
|
||||||
|
group.setCreateBy(SecurityUtils.getUserId().toString());
|
||||||
|
group.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||||
AirlineAreaGroupDTO dto = AirlineAreaGroupControllerConvert.to(group);
|
AirlineAreaGroupDTO dto = AirlineAreaGroupControllerConvert.to(group);
|
||||||
if (iAirlineAreaGroupService.checkGroupNameUnique(dto)) {
|
if (iAirlineAreaGroupService.checkGroupNameUnique(dto)) {
|
||||||
return error("新增分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
return error("新增分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
||||||
|
|
@ -76,6 +78,7 @@ public class AirlineAreaGroupController extends BaseController {
|
||||||
@Operation(summary = "修改分组")
|
@Operation(summary = "修改分组")
|
||||||
public AjaxResult edit(@Validated @RequestBody AirlineAreaGroupVO group) {
|
public AjaxResult edit(@Validated @RequestBody AirlineAreaGroupVO group) {
|
||||||
group.setUserId(SecurityUtils.getUserId());
|
group.setUserId(SecurityUtils.getUserId());
|
||||||
|
group.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||||
AirlineAreaGroupDTO dto = AirlineAreaGroupControllerConvert.to(group);
|
AirlineAreaGroupDTO dto = AirlineAreaGroupControllerConvert.to(group);
|
||||||
if (iAirlineAreaGroupService.checkGroupNameUnique(dto)) {
|
if (iAirlineAreaGroupService.checkGroupNameUnique(dto)) {
|
||||||
return error("修改分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
return error("修改分组'" + group.getGroupName() + "'失败,分组名称已存在");
|
||||||
|
|
@ -115,6 +118,8 @@ public class AirlineAreaGroupController extends BaseController {
|
||||||
@PutMapping("/updateArea")
|
@PutMapping("/updateArea")
|
||||||
@Operation(summary = "修改空域信息")
|
@Operation(summary = "修改空域信息")
|
||||||
public AjaxResult updateAreaWithPoints(@Validated @RequestBody AirlineAreaVO area) {
|
public AjaxResult updateAreaWithPoints(@Validated @RequestBody AirlineAreaVO area) {
|
||||||
|
// 设置更新人
|
||||||
|
area.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||||
// 使用转换类进行转换
|
// 使用转换类进行转换
|
||||||
AirlineAreaDTO dto = AirlineAreaControllerConvert.to(area);
|
AirlineAreaDTO dto = AirlineAreaControllerConvert.to(area);
|
||||||
return toAjax(iAirlineAreaGroupService.updateAreaWithPoints(dto));
|
return toAjax(iAirlineAreaGroupService.updateAreaWithPoints(dto));
|
||||||
|
|
@ -130,6 +135,9 @@ public class AirlineAreaGroupController extends BaseController {
|
||||||
@PostMapping("/addArea/{groupId}")
|
@PostMapping("/addArea/{groupId}")
|
||||||
@Operation(summary = "在指定分组下新增空域")
|
@Operation(summary = "在指定分组下新增空域")
|
||||||
public AjaxResult addAreaWithGroup(@PathVariable Long groupId, @Validated @RequestBody AirlineAreaVO area) {
|
public AjaxResult addAreaWithGroup(@PathVariable Long groupId, @Validated @RequestBody AirlineAreaVO area) {
|
||||||
|
// 设置创建人和更新人
|
||||||
|
area.setCreateBy(SecurityUtils.getUserId().toString());
|
||||||
|
area.setUpdateBy(SecurityUtils.getUserId().toString());
|
||||||
// 使用转换类进行转换
|
// 使用转换类进行转换
|
||||||
AirlineAreaDTO dto = AirlineAreaControllerConvert.to(area);
|
AirlineAreaDTO dto = AirlineAreaControllerConvert.to(area);
|
||||||
return toAjax(iAirlineAreaGroupService.insertAreaWithGroup(groupId, dto));
|
return toAjax(iAirlineAreaGroupService.insertAreaWithGroup(groupId, dto));
|
||||||
|
|
@ -146,4 +154,51 @@ public class AirlineAreaGroupController extends BaseController {
|
||||||
public AjaxResult deleteArea(@PathVariable Long areaId) {
|
public AjaxResult deleteArea(@PathVariable Long areaId) {
|
||||||
return toAjax(iAirlineAreaGroupService.deleteArea(areaId));
|
return toAjax(iAirlineAreaGroupService.deleteArea(areaId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量移动空域到新分组
|
||||||
|
*
|
||||||
|
* @param areaIds 空域ID列表
|
||||||
|
* @param groupId 原分组ID
|
||||||
|
* @param newGroupId 新分组ID
|
||||||
|
* @return 移动结果
|
||||||
|
*/
|
||||||
|
@PostMapping("/move/{groupId}/{newGroupId}")
|
||||||
|
@Operation(summary = "批量移动空域到新分组")
|
||||||
|
public AjaxResult batchMove(@RequestBody List<Long> areaIds, @PathVariable("groupId") Long groupId, @PathVariable("newGroupId") Long newGroupId) {
|
||||||
|
if (groupId == null) {
|
||||||
|
return error("原分组ID不能为空");
|
||||||
|
}
|
||||||
|
if (newGroupId == null) {
|
||||||
|
return error("新分组ID不能为空");
|
||||||
|
}
|
||||||
|
if (areaIds == null || areaIds.isEmpty()) {
|
||||||
|
return error("没有需要移动的空域");
|
||||||
|
}
|
||||||
|
int result = iAirlineAreaGroupService.batchMoveAreaToNewGroup(areaIds, groupId, newGroupId);
|
||||||
|
if (result > 0) {
|
||||||
|
return success("移动成功,共移动 " + result + " 个空域");
|
||||||
|
}
|
||||||
|
return error("移动失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询空域列表,支持名称模糊查询
|
||||||
|
*
|
||||||
|
* @param area 查询条件
|
||||||
|
* @return 空域列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/areaList")
|
||||||
|
@Operation(summary = "根据用户ID查询空域列表")
|
||||||
|
public AjaxResult selectAreaListByUserId(AirlineAreaVO area) {
|
||||||
|
// 设置用户ID
|
||||||
|
area.setCreateBy(SecurityUtils.getUserId().toString());
|
||||||
|
// 转换为DTO
|
||||||
|
AirlineAreaDTO dto = AirlineAreaControllerConvert.to(area);
|
||||||
|
// 调用服务层方法
|
||||||
|
List<AirlineAreaDTO> list = iAirlineAreaGroupService.selectAreaListByUserId(dto);
|
||||||
|
// 转换为VO
|
||||||
|
List<AirlineAreaVO> result = AirlineAreaControllerConvert.fromList(list);
|
||||||
|
return success(result);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,6 +58,9 @@ public class AirlineAreaControllerConvert extends BaseConvert<AirlineAreaDTO, Ai
|
||||||
vo.setName(dto.getName());
|
vo.setName(dto.getName());
|
||||||
vo.setAreaType(dto.getAreaType());
|
vo.setAreaType(dto.getAreaType());
|
||||||
vo.setStatus(dto.getStatus());
|
vo.setStatus(dto.getStatus());
|
||||||
|
vo.setAreaArea(dto.getAreaArea());
|
||||||
|
vo.setAreaPerimeter(dto.getAreaPerimeter());
|
||||||
|
vo.setRadius(dto.getRadius());
|
||||||
vo.setRemark(dto.getRemark());
|
vo.setRemark(dto.getRemark());
|
||||||
|
|
||||||
// 将字符串转换为 List<PointInfo>
|
// 将字符串转换为 List<PointInfo>
|
||||||
|
|
@ -86,6 +89,9 @@ public class AirlineAreaControllerConvert extends BaseConvert<AirlineAreaDTO, Ai
|
||||||
dto.setName(vo.getName());
|
dto.setName(vo.getName());
|
||||||
dto.setAreaType(vo.getAreaType());
|
dto.setAreaType(vo.getAreaType());
|
||||||
dto.setStatus(vo.getStatus());
|
dto.setStatus(vo.getStatus());
|
||||||
|
dto.setAreaArea(vo.getAreaArea());
|
||||||
|
dto.setAreaPerimeter(vo.getAreaPerimeter());
|
||||||
|
dto.setRadius(vo.getRadius());
|
||||||
dto.setRemark(vo.getRemark());
|
dto.setRemark(vo.getRemark());
|
||||||
|
|
||||||
// 将 List<PointInfo> 转换为字符串
|
// 将 List<PointInfo> 转换为字符串
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,11 @@ public interface IAirlineAreaDomain {
|
||||||
AirlineArea selectAreaById(Long id);
|
AirlineArea selectAreaById(Long id);
|
||||||
|
|
||||||
List<AirlineArea> selectAreaListByIds(List<Long> ids);
|
List<AirlineArea> selectAreaListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询空域列表
|
||||||
|
* @param model 查询条件
|
||||||
|
* @return 空域列表
|
||||||
|
*/
|
||||||
|
List<AirlineArea> selectAreaListByUserId(AirlineArea model);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,10 @@ public class AirlineAreaDomainImpl implements IAirlineAreaDomain {
|
||||||
public List<AirlineArea> selectAreaListByIds(List<Long> ids) {
|
public List<AirlineArea> selectAreaListByIds(List<Long> ids) {
|
||||||
return AirlineAreaDomainConvert.fromList(airlineAreaMapper.selectAreaListByIds(ids));
|
return AirlineAreaDomainConvert.fromList(airlineAreaMapper.selectAreaListByIds(ids));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AirlineArea> selectAreaListByUserId(AirlineArea model) {
|
||||||
|
AirlineAreaEntity entity = AirlineAreaDomainConvert.to(model);
|
||||||
|
return AirlineAreaDomainConvert.fromList(airlineAreaMapper.selectAreaListByUserId(entity));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,6 +40,21 @@ public class AirlineArea extends ExBaseEntity {
|
||||||
*/
|
*/
|
||||||
private String points;
|
private String points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private Double areaArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周长
|
||||||
|
*/
|
||||||
|
private Double areaPerimeter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半径
|
||||||
|
*/
|
||||||
|
private Double radius;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|
@ -53,6 +68,9 @@ public class AirlineArea extends ExBaseEntity {
|
||||||
.append("areaType", getAreaType())
|
.append("areaType", getAreaType())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("points", getPoints())
|
.append("points", getPoints())
|
||||||
|
.append("areaArea", getAreaArea())
|
||||||
|
.append("areaPerimeter", getAreaPerimeter())
|
||||||
|
.append("radius", getRadius())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,4 +22,11 @@ public interface AirlineAreaMapper {
|
||||||
AirlineAreaEntity selectAreaById(Long id);
|
AirlineAreaEntity selectAreaById(Long id);
|
||||||
|
|
||||||
List<AirlineAreaEntity> selectAreaListByIds(List<Long> ids);
|
List<AirlineAreaEntity> selectAreaListByIds(List<Long> ids);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询空域列表
|
||||||
|
* @param entity 查询条件
|
||||||
|
* @return 空域列表
|
||||||
|
*/
|
||||||
|
List<AirlineAreaEntity> selectAreaListByUserId(AirlineAreaEntity entity);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,21 @@ public class AirlineAreaEntity extends ExBaseEntity {
|
||||||
*/
|
*/
|
||||||
private String points;
|
private String points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private Double areaArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周长
|
||||||
|
*/
|
||||||
|
private Double areaPerimeter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半径
|
||||||
|
*/
|
||||||
|
private Double radius;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
|
||||||
|
|
@ -47,6 +62,9 @@ public class AirlineAreaEntity extends ExBaseEntity {
|
||||||
.append("areaType", getAreaType())
|
.append("areaType", getAreaType())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("points", getPoints())
|
.append("points", getPoints())
|
||||||
|
.append("areaArea", getAreaArea())
|
||||||
|
.append("areaPerimeter", getAreaPerimeter())
|
||||||
|
.append("radius", getRadius())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -71,8 +71,8 @@ public class AirlineFileEntity extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String fileMd5;
|
private String fileMd5;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 用户ID
|
* 分组ID
|
||||||
*/
|
*/
|
||||||
private Long groupId;
|
private Long groupId;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,4 +60,20 @@ public interface IAirlineAreaGroupService {
|
||||||
* @return 删除结果
|
* @return 删除结果
|
||||||
*/
|
*/
|
||||||
int deleteArea(Long areaId);
|
int deleteArea(Long areaId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量移动空域到新分组
|
||||||
|
* @param areaIds 空域ID列表
|
||||||
|
* @param oldGroupId 原分组ID
|
||||||
|
* @param newGroupId 新分组ID
|
||||||
|
* @return 移动结果
|
||||||
|
*/
|
||||||
|
int batchMoveAreaToNewGroup(List<Long> areaIds, Long oldGroupId, Long newGroupId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户ID查询空域列表
|
||||||
|
* @param dto 查询条件
|
||||||
|
* @return 空域列表
|
||||||
|
*/
|
||||||
|
List<AirlineAreaDTO> selectAreaListByUserId(AirlineAreaDTO dto);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,21 @@ public class AirlineAreaDTO extends BaseEntity {
|
||||||
*/
|
*/
|
||||||
private String points;
|
private String points;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 面积
|
||||||
|
*/
|
||||||
|
private Double areaArea;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 周长
|
||||||
|
*/
|
||||||
|
private Double areaPerimeter;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 半径
|
||||||
|
*/
|
||||||
|
private Double radius;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
|
|
@ -52,6 +67,9 @@ public class AirlineAreaDTO extends BaseEntity {
|
||||||
.append("areaType", getAreaType())
|
.append("areaType", getAreaType())
|
||||||
.append("status", getStatus())
|
.append("status", getStatus())
|
||||||
.append("points", getPoints())
|
.append("points", getPoints())
|
||||||
|
.append("areaArea", getAreaArea())
|
||||||
|
.append("areaPerimeter", getAreaPerimeter())
|
||||||
|
.append("radius", getRadius())
|
||||||
.append("remark", getRemark())
|
.append("remark", getRemark())
|
||||||
.toString();
|
.toString();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -131,6 +131,8 @@ public class AirlineAreaGroupServiceImpl implements IAirlineAreaGroupService {
|
||||||
AirlineAreaGroupInfo groupInfo = new AirlineAreaGroupInfo();
|
AirlineAreaGroupInfo groupInfo = new AirlineAreaGroupInfo();
|
||||||
groupInfo.setGroupId(groupId);
|
groupInfo.setGroupId(groupId);
|
||||||
groupInfo.setAreaId(model.getId());
|
groupInfo.setAreaId(model.getId());
|
||||||
|
groupInfo.setCreateBy(area.getCreateBy());
|
||||||
|
groupInfo.setUpdateBy(area.getUpdateBy());
|
||||||
iAirlineAreaGroupInfoDomain.insertGroupInfo(groupInfo);
|
iAirlineAreaGroupInfoDomain.insertGroupInfo(groupInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -150,4 +152,37 @@ public class AirlineAreaGroupServiceImpl implements IAirlineAreaGroupService {
|
||||||
areaModel.setId(areaId);
|
areaModel.setId(areaId);
|
||||||
return iAirlineAreaDomain.deleteArea(areaModel);
|
return iAirlineAreaDomain.deleteArea(areaModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int batchMoveAreaToNewGroup(List<Long> areaIds, Long oldGroupId, Long newGroupId) {
|
||||||
|
int movedCount = 0;
|
||||||
|
|
||||||
|
// 遍历每个空域ID
|
||||||
|
for (Long areaId : areaIds) {
|
||||||
|
// 1、删除原分组关联
|
||||||
|
AirlineAreaGroupInfoDTO deleteDto = new AirlineAreaGroupInfoDTO();
|
||||||
|
deleteDto.setGroupId(oldGroupId);
|
||||||
|
deleteDto.setAreaId(areaId);
|
||||||
|
AirlineAreaGroupInfo deleteModel = AirlineAreaGroupInfoServiceConvert.to(deleteDto);
|
||||||
|
iAirlineAreaGroupInfoDomain.deleteGroupInfo(deleteModel);
|
||||||
|
|
||||||
|
// 2、添加新分组关联
|
||||||
|
AirlineAreaGroupInfoDTO insertDto = new AirlineAreaGroupInfoDTO();
|
||||||
|
insertDto.setGroupId(newGroupId);
|
||||||
|
insertDto.setAreaId(areaId);
|
||||||
|
AirlineAreaGroupInfo insertModel = AirlineAreaGroupInfoServiceConvert.to(insertDto);
|
||||||
|
int result = iAirlineAreaGroupInfoDomain.insertGroupInfo(insertModel);
|
||||||
|
if (result > 0) {
|
||||||
|
movedCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return movedCount;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<AirlineAreaDTO> selectAreaListByUserId(AirlineAreaDTO dto) {
|
||||||
|
AirlineArea model = AirlineAreaServiceConvert.to(dto);
|
||||||
|
return AirlineAreaServiceConvert.fromList(iAirlineAreaDomain.selectAreaListByUserId(model));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,9 @@ CREATE TABLE IF NOT EXISTS airline_area (
|
||||||
area_type VARCHAR(255) COMMENT '空域类型',
|
area_type VARCHAR(255) COMMENT '空域类型',
|
||||||
status INT(11) DEFAULT 1 COMMENT '1 启用 0 停用。默认启用。',
|
status INT(11) DEFAULT 1 COMMENT '1 启用 0 停用。默认启用。',
|
||||||
points JSON COMMENT '空域点列表',
|
points JSON COMMENT '空域点列表',
|
||||||
|
area_area DOUBLE DEFAULT NULL COMMENT '面积',
|
||||||
|
area_perimeter DOUBLE DEFAULT NULL COMMENT '周长',
|
||||||
|
radius DOUBLE DEFAULT NULL COMMENT '半径',
|
||||||
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
create_by VARCHAR(64) DEFAULT '' COMMENT '创建者',
|
||||||
create_time DATETIME COMMENT '创建时间',
|
create_time DATETIME COMMENT '创建时间',
|
||||||
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
update_by VARCHAR(64) DEFAULT '' COMMENT '更新者',
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="areaType" column="area_type" />
|
<result property="areaType" column="area_type" />
|
||||||
<result property="status" column="status" />
|
<result property="status" column="status" />
|
||||||
<result property="points" column="points" />
|
<result property="points" column="points" />
|
||||||
|
<result property="areaArea" column="area_area" />
|
||||||
|
<result property="areaPerimeter" column="area_perimeter" />
|
||||||
|
<result property="radius" column="radius" />
|
||||||
<result property="createBy" column="create_by" />
|
<result property="createBy" column="create_by" />
|
||||||
<result property="createTime" column="create_time" />
|
<result property="createTime" column="create_time" />
|
||||||
<result property="updateBy" column="update_by" />
|
<result property="updateBy" column="update_by" />
|
||||||
|
|
@ -20,8 +23,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<!-- 插入空域 -->
|
<!-- 插入空域 -->
|
||||||
<insert id="insertArea" parameterType="com.ruoyi.airline.mapper.entity.AirlineAreaEntity" useGeneratedKeys="true" keyProperty="id">
|
<insert id="insertArea" parameterType="com.ruoyi.airline.mapper.entity.AirlineAreaEntity" useGeneratedKeys="true" keyProperty="id">
|
||||||
insert into airline_area (name, area_type, status, points, create_by, create_time, update_by, update_time, remark)
|
insert into airline_area (name, area_type, status, points, area_area, area_perimeter, radius, create_by, create_time, update_by, update_time, remark)
|
||||||
values (#{name}, #{areaType}, #{status}, #{points}, #{createBy}, now(), #{updateBy}, now(), #{remark})
|
values (#{name}, #{areaType}, #{status}, #{points}, #{areaArea}, #{areaPerimeter}, #{radius}, #{createBy}, now(), #{updateBy}, now(), #{remark})
|
||||||
</insert>
|
</insert>
|
||||||
|
|
||||||
<!-- 更新空域 -->
|
<!-- 更新空域 -->
|
||||||
|
|
@ -31,6 +34,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
area_type = #{areaType},
|
area_type = #{areaType},
|
||||||
status = #{status},
|
status = #{status},
|
||||||
points = #{points},
|
points = #{points},
|
||||||
|
area_area = #{areaArea},
|
||||||
|
area_perimeter = #{areaPerimeter},
|
||||||
|
radius = #{radius},
|
||||||
update_by = #{updateBy},
|
update_by = #{updateBy},
|
||||||
update_time = now(),
|
update_time = now(),
|
||||||
remark = #{remark}
|
remark = #{remark}
|
||||||
|
|
@ -48,7 +54,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<!-- 查询空域列表 -->
|
<!-- 查询空域列表 -->
|
||||||
<select id="selectAreaList" parameterType="com.ruoyi.airline.mapper.entity.AirlineAreaEntity" resultMap="AirlineAreaResult">
|
<select id="selectAreaList" parameterType="com.ruoyi.airline.mapper.entity.AirlineAreaEntity" resultMap="AirlineAreaResult">
|
||||||
select id, name, area_type, status, points, create_by, create_time, update_by, update_time, remark
|
select id, name, area_type, status, points, area_area, area_perimeter, radius, create_by, create_time, update_by, update_time, remark
|
||||||
from airline_area
|
from airline_area
|
||||||
<where>
|
<where>
|
||||||
<if test="name != null and name != ''">
|
<if test="name != null and name != ''">
|
||||||
|
|
@ -65,14 +71,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
|
|
||||||
<!-- 根据ID查询空域 -->
|
<!-- 根据ID查询空域 -->
|
||||||
<select id="selectAreaById" parameterType="java.lang.Long" resultMap="AirlineAreaResult">
|
<select id="selectAreaById" parameterType="java.lang.Long" resultMap="AirlineAreaResult">
|
||||||
select id, name, area_type, status, points, create_by, create_time, update_by, update_time, remark
|
select id, name, area_type, status, points, area_area, area_perimeter, radius, create_by, create_time, update_by, update_time, remark
|
||||||
from airline_area
|
from airline_area
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据ID列表查询空域 -->
|
<!-- 根据ID列表查询空域 -->
|
||||||
<select id="selectAreaListByIds" parameterType="java.util.List" resultMap="AirlineAreaResult">
|
<select id="selectAreaListByIds" parameterType="java.util.List" resultMap="AirlineAreaResult">
|
||||||
select id, name, area_type, status, points, create_by, create_time, update_by, update_time, remark
|
select id, name, area_type, status, points, area_area, area_perimeter, radius, create_by, create_time, update_by, update_time, remark
|
||||||
from airline_area
|
from airline_area
|
||||||
where id in
|
where id in
|
||||||
<foreach item="id" collection="list" open="(" separator="," close=")">
|
<foreach item="id" collection="list" open="(" separator="," close=")">
|
||||||
|
|
@ -80,4 +86,31 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</foreach>
|
</foreach>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询空域列表 -->
|
||||||
|
<select id="selectAreaListByUserId" parameterType="com.ruoyi.airline.mapper.entity.AirlineAreaEntity" resultMap="AirlineAreaResult">
|
||||||
|
select distinct aa.id, aa.name, aa.area_type, aa.status, aa.points, aa.area_area, aa.area_perimeter, aa.radius, aa.create_by, aa.create_time, aa.update_by, aa.update_time, aa.remark
|
||||||
|
from airline_area aa
|
||||||
|
left join airline_area_group_info aagi on aa.id = aagi.area_id
|
||||||
|
left join airline_area_group aag on aagi.group_id = aag.group_id
|
||||||
|
<where>
|
||||||
|
and aagi.del_flag = 0
|
||||||
|
and aag.del_flag = 0
|
||||||
|
<if test="createBy != null">
|
||||||
|
and aa.create_by = #{createBy}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
and aa.name like concat('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="areaType != null and areaType != ''">
|
||||||
|
and aa.area_type = #{areaType}
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and aa.status = #{status}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<if test="updateTimeOrderBy != null and updateTimeOrderBy != ''">
|
||||||
|
order by aa.update_time #{updateTimeOrderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -39,7 +39,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
<result property="groupName" column="group_name" />
|
<result property="groupName" column="group_name" />
|
||||||
<result property="groupId" column="group_id" />
|
<result property="groupId" column="group_id" />
|
||||||
<result property="userId" column="user_id" />
|
<result property="userId" column="user_id" />
|
||||||
<result property="userId" column="user_id" />
|
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -119,5 +118,35 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</where>
|
</where>
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<!-- 根据用户ID查询航线列表 -->
|
||||||
|
<select id="selectAirlineListByUserId" parameterType="com.ruoyi.airline.mapper.entity.AirlineFileEntity" resultMap="AirlineFileResult">
|
||||||
|
select
|
||||||
|
af.*,
|
||||||
|
afg.group_name
|
||||||
|
from airline_file af
|
||||||
|
left join airline_file_group_info afgi on af.id = afgi.airline_id and afgi.del_flag = 0
|
||||||
|
left join airline_file_group afg on afgi.group_id = afg.group_id and afg.del_flag = 0
|
||||||
|
<where>
|
||||||
|
af.del_flag = 0
|
||||||
|
<if test="userId != null">
|
||||||
|
and af.user_id = #{userId}
|
||||||
|
</if>
|
||||||
|
<if test="name != null and name != ''">
|
||||||
|
and af.name like concat('%', #{name}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="airVendor != null and airVendor != ''">
|
||||||
|
and af.air_vendor like concat('%', #{airVendor}, '%')
|
||||||
|
</if>
|
||||||
|
<if test="status != null">
|
||||||
|
and af.status = #{status}
|
||||||
|
</if>
|
||||||
|
<if test="type != null and type != ''">
|
||||||
|
and af.type = #{type}
|
||||||
|
</if>
|
||||||
|
</where>
|
||||||
|
<if test="updateTimeOrderBy != null and updateTimeOrderBy != ''">
|
||||||
|
order by af.update_time #{updateTimeOrderBy}
|
||||||
|
</if>
|
||||||
|
</select>
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
@ -47,7 +47,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
<!-- 根据分组ID和航线名称模糊查询航线文件 -->
|
<!-- 根据分组ID和航线名称模糊查询航线文件 -->
|
||||||
<select id="selectFileNameLikeByGroupId" resultMap="AirlineFileResult">
|
<select id="selectFileNameLikeByGroupId" parameterType="java.util.Map" resultMap="AirlineFileResult">
|
||||||
select af.id, af.name, af.air_vendor, af.air_type, af.file_name, af.file_url, af.type, af.source, af.status, af.file_md5, af.create_by, af.create_time, af.update_by, af.update_time, af.remark
|
select af.id, af.name, af.air_vendor, af.air_type, af.file_name, af.file_url, af.type, af.source, af.status, af.file_md5, af.create_by, af.create_time, af.update_by, af.update_time, af.remark
|
||||||
from airline_file af
|
from airline_file af
|
||||||
inner join airline_file_group_info afgi on af.id = afgi.airline_id
|
inner join airline_file_group_info afgi on af.id = afgi.airline_id
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue