feat(): 优化精确查询围栏组,使其能够查询围栏信息
parent
abafd16cf1
commit
3ad8fb4233
|
@ -48,10 +48,6 @@ public class RemoteUserFallbackFactory implements FallbackFactory<RemoteUserServ
|
||||||
return Result.error("注册用户失败:" + throwable.getMessage());
|
return Result.error("注册用户失败:" + throwable.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public Result list(SysCarMessage sysCarMessage) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Result<List<SysUser>> companyList() {
|
public Result<List<SysUser>> companyList() {
|
||||||
|
|
|
@ -10,6 +10,7 @@ import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 围栏组对象 sys_fence_group
|
* 围栏组对象 sys_fence_group
|
||||||
|
@ -48,6 +49,8 @@ public class SysFence{
|
||||||
@Excel(name = "启用状态")
|
@Excel(name = "启用状态")
|
||||||
private String state;
|
private String state;
|
||||||
|
|
||||||
|
private List<SysCorpuscle> corpuscleList;
|
||||||
|
|
||||||
/** 创建人 */
|
/** 创建人 */
|
||||||
@Excel(name = "创建人")
|
@Excel(name = "创建人")
|
||||||
private String createBy;
|
private String createBy;
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.muyu.common.core.utils.poi.ExcelUtil;
|
||||||
import com.muyu.common.core.web.controller.BaseController;
|
import com.muyu.common.core.web.controller.BaseController;
|
||||||
import com.muyu.common.core.web.page.TableDataInfo;
|
import com.muyu.common.core.web.page.TableDataInfo;
|
||||||
import com.muyu.common.security.annotation.RequiresPermissions;
|
import com.muyu.common.security.annotation.RequiresPermissions;
|
||||||
|
import com.muyu.openbusiness.service.ISysCorpuscleService;
|
||||||
import com.muyu.openbusiness.service.ISysFenceService;
|
import com.muyu.openbusiness.service.ISysFenceService;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
@ -28,6 +29,7 @@ public class SysFenceController extends BaseController
|
||||||
@Resource
|
@Resource
|
||||||
private ISysFenceService sysFenceService;
|
private ISysFenceService sysFenceService;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询围栏组列表
|
* 查询围栏组列表
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -2,8 +2,12 @@ package com.muyu.openbusiness.mapper;
|
||||||
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import com.muyu.openbusiness.domain.SysCorpuscle;
|
||||||
import com.muyu.openbusiness.domain.SysFence;
|
import com.muyu.openbusiness.domain.SysFence;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
import org.apache.ibatis.annotations.Param;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 围栏组Mapper接口
|
* 围栏组Mapper接口
|
||||||
|
@ -14,4 +18,5 @@ import org.apache.ibatis.annotations.Mapper;
|
||||||
@Mapper
|
@Mapper
|
||||||
public interface SysFenceMapper extends BaseMapper<SysFence>{
|
public interface SysFenceMapper extends BaseMapper<SysFence>{
|
||||||
|
|
||||||
|
List<SysCorpuscle> selectMid(@Param("id") Long id);
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,12 +6,14 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
import com.muyu.openbusiness.config.SnowflakeIdWorker;
|
||||||
import com.muyu.openbusiness.domain.SysFence;
|
import com.muyu.openbusiness.domain.SysFence;
|
||||||
import com.muyu.openbusiness.mapper.SysFenceMapper;
|
import com.muyu.openbusiness.mapper.SysFenceMapper;
|
||||||
|
import com.muyu.openbusiness.service.ISysCorpuscleService;
|
||||||
import com.muyu.openbusiness.service.ISysFenceService;
|
import com.muyu.openbusiness.service.ISysFenceService;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.data.redis.core.RedisTemplate;
|
import org.springframework.data.redis.core.RedisTemplate;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import javax.annotation.Resource;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,15 +29,20 @@ public class SysFenceServiceImpl
|
||||||
extends ServiceImpl<SysFenceMapper, SysFence>
|
extends ServiceImpl<SysFenceMapper, SysFence>
|
||||||
implements ISysFenceService {
|
implements ISysFenceService {
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
RedisTemplate redisTemplate;
|
private RedisTemplate redisTemplate;
|
||||||
|
@Resource
|
||||||
|
private SysFenceMapper sysFenceMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public SysFence selectSysFenceById(Long id) {
|
public SysFence selectSysFenceById(Long id) {
|
||||||
|
|
||||||
LambdaQueryWrapper<SysFence> queryWrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<SysFence> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
Assert.notNull(id, "id不可为空");
|
Assert.notNull(id, "id不可为空");
|
||||||
queryWrapper.eq(SysFence::getId, id);
|
queryWrapper.eq(SysFence::getId, id);
|
||||||
return this.getOne(queryWrapper);
|
SysFence one = this.getOne(queryWrapper);
|
||||||
|
one.setCorpuscleList(sysFenceMapper.selectMid(id));
|
||||||
|
return one;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -60,11 +67,12 @@ public class SysFenceServiceImpl
|
||||||
System.out.println(id);
|
System.out.println(id);
|
||||||
|
|
||||||
}
|
}
|
||||||
redisTemplate.opsForValue().set("id",list(queryWrapper));
|
List<SysFence> list = this.list(queryWrapper);
|
||||||
return this.list(queryWrapper);
|
redisTemplate.opsForValue().set("id",list);
|
||||||
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean checkIdUnique(SysFence sysFence) {
|
public Boolean checkIdUnique(SysFence sysFence) {
|
||||||
return null;
|
return null;
|
||||||
|
|
|
@ -38,7 +38,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||||
where id = #{id}
|
where id = #{id}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<select id="selectMid" resultType="com.muyu.openbusiness.domain.SysCorpuscle">
|
||||||
|
select f.id, f.fence_code, f.fence_name, f.fence_position, f.state,m.type fenceType from sys_fence_group g
|
||||||
|
left join sys_fence_group_mid m on g.id = m.group_id
|
||||||
|
left join sys_corpuscle_fence f on m.fence_id = f.id
|
||||||
|
where g.group_id = #{id}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
|
||||||
<delete id="deleteSysFenceById" parameterType="Long">
|
<delete id="deleteSysFenceById" parameterType="Long">
|
||||||
|
|
Loading…
Reference in New Issue