fix():重构电子围栏以及围栏组
parent
0619a5102c
commit
ffc698bc11
|
@ -1,19 +0,0 @@
|
|||
package com.muyu.fence;
|
||||
|
||||
import com.muyu.common.security.annotation.EnableMyFeignClients;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 电子围栏启动类
|
||||
* @Version 1.0
|
||||
* @Data 2024-09-18 11:27:38
|
||||
*/
|
||||
@SpringBootApplication
|
||||
@EnableMyFeignClients
|
||||
public class FenceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(FenceApplication.class, args);
|
||||
}
|
||||
}
|
|
@ -19,7 +19,7 @@ import org.springframework.web.bind.annotation.*;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.controller
|
||||
* @Project:cloud-server
|
||||
* @name:FenceEtlController
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.Collection;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.controller
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupController
|
||||
|
|
|
@ -1,112 +0,0 @@
|
|||
package com.muyu.fence.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import javax.annotation.Resource;
|
||||
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.muyu.common.security.annotation.RequiresPermissions;
|
||||
import com.muyu.fence.domain.TbFence;
|
||||
import com.muyu.fence.service.ITbFenceService;
|
||||
import com.muyu.common.core.web.controller.BaseController;
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||
import com.muyu.common.security.utils.SecurityUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import com.muyu.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 电子围栏Controller
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/fence")
|
||||
public class TbFenceController extends BaseController
|
||||
{
|
||||
@Resource
|
||||
private ITbFenceService tbFenceService;
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:list")
|
||||
@GetMapping("/list")
|
||||
public Result<TableDataInfo<TbFence>> list(TbFence tbFence)
|
||||
{
|
||||
startPage();
|
||||
List<TbFence> list = tbFenceService.selectTbFenceList(tbFence);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出电子围栏列表
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:export")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, TbFence tbFence)
|
||||
{
|
||||
List<TbFence> list = tbFenceService.selectTbFenceList(tbFence);
|
||||
ExcelUtil<TbFence> util = new ExcelUtil<TbFence>(TbFence.class);
|
||||
util.exportExcel(response, list, "电子围栏数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取电子围栏详细信息
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:query")
|
||||
@GetMapping(value = "/{fenceId}")
|
||||
public Result<List<TbFence>> getInfo(@PathVariable("fenceId") Long fenceId)
|
||||
{
|
||||
return success(tbFenceService.selectTbFenceByFenceId(fenceId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增电子围栏
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:add")
|
||||
@PostMapping
|
||||
public Result<Integer> add(
|
||||
@Validated @RequestBody TbFence tbFence)
|
||||
{
|
||||
if (tbFenceService.checkIdUnique(tbFence)) {
|
||||
return error("新增 电子围栏 '" + tbFence + "'失败,电子围栏已存在");
|
||||
}
|
||||
tbFence.setCreateBy(SecurityUtils.getUsername());
|
||||
return toAjax(tbFenceService.save(tbFence));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改电子围栏
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:edit")
|
||||
@PutMapping
|
||||
public Result<Integer> edit(
|
||||
@Validated @RequestBody TbFence tbFence)
|
||||
{
|
||||
if (!tbFenceService.checkIdUnique(tbFence)) {
|
||||
return error("修改 电子围栏 '" + tbFence + "'失败,电子围栏不存在");
|
||||
}
|
||||
tbFence.setUpdateBy(SecurityUtils.getUsername());
|
||||
return toAjax(tbFenceService.updateById(tbFence));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除电子围栏
|
||||
*/
|
||||
@RequiresPermissions("fence:fence:remove")
|
||||
@DeleteMapping("/{fenceIds}")
|
||||
public Result<Integer> remove(@PathVariable("fenceIds") Long[] fenceIds)
|
||||
{
|
||||
tbFenceService.removeBatchByIds(Arrays.asList(fenceIds));
|
||||
return success();
|
||||
}
|
||||
}
|
|
@ -1,36 +0,0 @@
|
|||
package com.muyu.fence.controller;
|
||||
|
||||
import com.muyu.common.core.domain.Result;
|
||||
import com.muyu.fence.domain.TbGroup;
|
||||
import com.muyu.fence.service.TbGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 围栏控制器
|
||||
* @Version 1.0
|
||||
* @Data 2024-09-22 17:00:08
|
||||
*/
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/tbGroup")
|
||||
public class TbGroupController {
|
||||
|
||||
@Autowired
|
||||
private TbGroupService tbGroupService;
|
||||
|
||||
/**
|
||||
* 查询围栏列表
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/selectTbGroupList")
|
||||
public Result<List<TbGroup>> selectTbGroupList() {
|
||||
return Result.success(tbGroupService.selectTbGroupList());
|
||||
}
|
||||
|
||||
}
|
|
@ -1,72 +0,0 @@
|
|||
package com.muyu.fence.domain;
|
||||
|
||||
import com.muyu.common.core.annotation.Excel;
|
||||
import com.muyu.common.core.web.domain.BaseEntity;
|
||||
import lombok.*;
|
||||
import lombok.experimental.SuperBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
|
||||
/**
|
||||
* 电子围栏对象 tb_fence
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
|
||||
@Data
|
||||
@Setter
|
||||
@Getter
|
||||
@SuperBuilder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@TableName("tb_fence")
|
||||
public class TbFence extends BaseEntity{
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/** 围栏编号 */
|
||||
@TableId( type = IdType.AUTO)
|
||||
private Long fenceId;
|
||||
|
||||
/** 围栏名称 */
|
||||
@Excel(name = "围栏名称")
|
||||
private String fenceName;
|
||||
|
||||
/** 围栏类型1.驶入2驶出 */
|
||||
@Excel(name = "围栏类型1.驶入2驶出")
|
||||
private Long fenceType;
|
||||
|
||||
/** 围栏状态1.正常2.停用 */
|
||||
@Excel(name = "围栏状态1.正常2.停用")
|
||||
private Long fenceFlag;
|
||||
|
||||
/** 经纬度信息 */
|
||||
@Excel(name = "经纬度信息")
|
||||
private String longitudeAndLatitudeInformation;
|
||||
|
||||
/** 优先级 */
|
||||
@Excel(name = "优先级")
|
||||
private String fencePriority;
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
|
||||
.append("fenceId", getFenceId())
|
||||
.append("fenceName", getFenceName())
|
||||
.append("fenceType", getFenceType())
|
||||
.append("fenceFlag", getFenceFlag())
|
||||
.append("longitudeAndLatitudeInformation", getLongitudeAndLatitudeInformation())
|
||||
.append("fencePriority", getFencePriority())
|
||||
.append("createBy", getCreateBy())
|
||||
.append("createTime", getCreateTime())
|
||||
.append("updateBy", getUpdateBy())
|
||||
.append("updateTime", getUpdateTime())
|
||||
.append("remark", getRemark())
|
||||
.toString();
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
package com.muyu.fence.domain;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 围栏组
|
||||
* @Version 1.0
|
||||
* @Data 2024-09-22 16:55:16
|
||||
*/
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class TbGroup {
|
||||
/**
|
||||
* 围栏组编号
|
||||
*/
|
||||
private Integer groupId;
|
||||
/**
|
||||
* 围栏组名称
|
||||
*/
|
||||
private String groupName;
|
||||
}
|
|
@ -16,7 +16,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFence
|
||||
|
|
|
@ -16,7 +16,7 @@ import lombok.experimental.SuperBuilder;
|
|||
import java.util.function.Supplier;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroup
|
||||
|
|
|
@ -9,7 +9,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMid
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicAdd
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicFenceReq
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectroicFenceUpdReq
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupAddReq
|
||||
|
|
|
@ -8,7 +8,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupListReq
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupAddReq
|
||||
|
|
|
@ -9,7 +9,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:FenceAndGroupBoundReq
|
||||
|
|
|
@ -5,7 +5,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:FenceWay
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.resp
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceGroupResp
|
||||
|
|
|
@ -11,7 +11,7 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFence
|
||||
|
|
|
@ -9,7 +9,7 @@ import lombok.Data;
|
|||
import lombok.NoArgsConstructor;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain.req
|
||||
* @Project:cloud-server
|
||||
* @name:GroupFenceListresp
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
package com.muyu.fence.domain.utils;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectricFenceModel
|
||||
|
|
|
@ -7,7 +7,7 @@ import lombok.NoArgsConstructor;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectricFenceResultTmp
|
||||
|
|
|
@ -9,7 +9,7 @@ import java.sql.Timestamp;
|
|||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceResult
|
||||
|
|
|
@ -10,7 +10,7 @@ import lombok.NoArgsConstructor;
|
|||
import lombok.experimental.SuperBuilder;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.domain
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceSetting
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.muyu.fence.domain.database.ElectronicFenceGroup;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.mapper
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMapper
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.muyu.fence.domain.database.ElectronicFence;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.mapper
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceMapper
|
||||
|
|
|
@ -5,7 +5,7 @@ import com.muyu.fence.domain.database.FenceGroupMid;
|
|||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.mapper
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMidMapper
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
package com.muyu.fence.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.fence.domain.TbFence;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 电子围栏Mapper接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
@Mapper
|
||||
public interface TbFenceMapper extends BaseMapper<TbFence>{
|
||||
|
||||
}
|
|
@ -1,12 +0,0 @@
|
|||
package com.muyu.fence.mapper;
|
||||
|
||||
import com.muyu.fence.domain.TbGroup;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Mapper
|
||||
public interface TbGroupDao {
|
||||
//查询围栏组列表
|
||||
public List<TbGroup> selectTbGroupList();
|
||||
}
|
|
@ -10,7 +10,7 @@ import com.muyu.fence.domain.resp.ElectronicFenceGroupResp;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupController
|
||||
|
|
|
@ -9,7 +9,7 @@ import com.muyu.fence.domain.resp.ElectronicFenceResp;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceService
|
||||
|
|
|
@ -8,7 +8,7 @@ import com.muyu.fence.domain.resp.ElectronicFenceResp;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMidService
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package com.muyu.fence.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.muyu.fence.domain.TbFence;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* 电子围栏Service接口
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
public interface ITbFenceService extends IService<TbFence> {
|
||||
/**
|
||||
* 精确查询电子围栏
|
||||
*
|
||||
* @param fenceId 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
public TbFence selectTbFenceByFenceId(Long fenceId);
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param tbFence 电子围栏
|
||||
* @return 电子围栏集合
|
||||
*/
|
||||
public List<TbFence> selectTbFenceList(TbFence tbFence);
|
||||
|
||||
/**
|
||||
* 判断 电子围栏 id是否唯一
|
||||
* @param tbFence 电子围栏
|
||||
* @return 结果
|
||||
*/
|
||||
Boolean checkIdUnique(TbFence tbFence);
|
||||
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
package com.muyu.fence.service;
|
||||
|
||||
import com.muyu.fence.domain.TbGroup;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface TbGroupService {
|
||||
//查询围栏组列表
|
||||
public List<TbGroup> selectTbGroupList();
|
||||
}
|
|
@ -22,7 +22,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service.impl
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupServiceImpl
|
||||
|
|
|
@ -20,7 +20,7 @@ import java.util.List;
|
|||
import java.util.Set;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service.impl
|
||||
* @Project:cloud-server
|
||||
* @name:ElectronicFenceServiceImpl
|
||||
|
|
|
@ -14,7 +14,7 @@ import org.springframework.stereotype.Service;
|
|||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author:张承志
|
||||
* @Author:yuping
|
||||
* @Package:com.muyu.fence.service.impl
|
||||
* @Project:cloud-server
|
||||
* @name:FenceGroupMidServiceImpl
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
package com.muyu.fence.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.muyu.fence.mapper.TbFenceMapper;
|
||||
import com.muyu.fence.domain.TbFence;
|
||||
import com.muyu.fence.service.ITbFenceService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.muyu.common.core.utils.StringUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
/**
|
||||
* 电子围栏Service业务层处理
|
||||
*
|
||||
* @author muyu
|
||||
* @date 2024-09-18
|
||||
*/
|
||||
@Service
|
||||
public class TbFenceServiceImpl
|
||||
extends ServiceImpl<TbFenceMapper, TbFence>
|
||||
implements ITbFenceService {
|
||||
|
||||
/**
|
||||
* 精确查询电子围栏
|
||||
*
|
||||
* @param fenceId 电子围栏主键
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public TbFence selectTbFenceByFenceId(Long fenceId)
|
||||
{
|
||||
LambdaQueryWrapper<TbFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Assert.notNull(fenceId, "fenceId不可为空");
|
||||
queryWrapper.eq(TbFence::getFenceId, fenceId);
|
||||
return this.getOne(queryWrapper);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询电子围栏列表
|
||||
*
|
||||
* @param tbFence 电子围栏
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public List<TbFence> selectTbFenceList(TbFence tbFence)
|
||||
{
|
||||
LambdaQueryWrapper<TbFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
if (StringUtils.isNotEmpty(tbFence.getFenceName())){
|
||||
queryWrapper.like(TbFence::getFenceName, tbFence.getFenceName());
|
||||
}
|
||||
if (tbFence.getFenceType()!=null){
|
||||
queryWrapper.eq(TbFence::getFenceType, tbFence.getFenceType());
|
||||
}
|
||||
if (tbFence.getFenceFlag()!=null){
|
||||
queryWrapper.eq(TbFence::getFenceFlag, tbFence.getFenceFlag());
|
||||
}
|
||||
if (StringUtils.isNotEmpty(tbFence.getLongitudeAndLatitudeInformation())){
|
||||
queryWrapper.eq(TbFence::getLongitudeAndLatitudeInformation, tbFence.getLongitudeAndLatitudeInformation());
|
||||
}
|
||||
if (tbFence.getFencePriority()!=null){
|
||||
queryWrapper.eq(TbFence::getFencePriority, tbFence.getFencePriority());
|
||||
}
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 唯一 判断
|
||||
* @param tbFence 电子围栏
|
||||
* @return 电子围栏
|
||||
*/
|
||||
@Override
|
||||
public Boolean checkIdUnique(TbFence tbFence) {
|
||||
LambdaQueryWrapper<TbFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TbFence::getFenceId, tbFence.getFenceId());
|
||||
return this.count(queryWrapper) > 0;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
package com.muyu.fence.service.impl;
|
||||
|
||||
import com.muyu.fence.domain.TbGroup;
|
||||
import com.muyu.fence.mapper.TbGroupDao;
|
||||
import com.muyu.fence.service.TbGroupService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Author YuPing
|
||||
* @Description 围栏组业务实现
|
||||
* @Version 1.0
|
||||
* @Data 2024-09-22 16:59:33
|
||||
*/
|
||||
|
||||
@Service
|
||||
public class TbGroupServiceImpl implements TbGroupService {
|
||||
|
||||
@Autowired
|
||||
private TbGroupDao tbGroupDao;
|
||||
|
||||
/**
|
||||
* 查询围栏组列表
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<TbGroup> selectTbGroupList() {
|
||||
return tbGroupDao.selectTbGroupList();
|
||||
}
|
||||
}
|
|
@ -1,17 +0,0 @@
|
|||
<?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">
|
||||
<!--
|
||||
1.在mybats的开发中namespace有特殊的意思,一定要是对应接口的全限定名
|
||||
通过namespace可以简历mapper.xml和接口之间的关系(名字不重要,位置不重要)
|
||||
-->
|
||||
<mapper namespace="com.muyu.fence.mapper.TbGroupDao">
|
||||
|
||||
<!--查询围栏组列表-->
|
||||
<select id="selectTbGroupList" resultType="com.muyu.fence.domain.TbGroup">
|
||||
select group_id, group_name
|
||||
from tb_group;
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue