添加查询区域信息sql

This commit is contained in:
yangjun 2025-07-21 15:20:33 +08:00
parent d8c48e0a36
commit 84641dabd4
6 changed files with 51 additions and 5 deletions

View File

@ -63,6 +63,20 @@ public class NuBaseInfoController extends JeecgController<NuBaseInfo, INuBaseInf
return Result.OK(pageList);
}
@ApiOperation(value = "护理单元(按区域查询列表)-分页列表查询", notes = "护理单元(按区域查询列表)-分页列表查询")
@GetMapping(value = "/qyList")
public Result<IPage<NuBaseInfo>> qyList(NuBaseInfo nuBaseInfo,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
QueryWrapper<NuBaseInfo> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfo, req.getParameterMap(), customeRuleMap);
Page<NuBaseInfo> page = new Page<NuBaseInfo>(pageNo, pageSize);
IPage<NuBaseInfo> pageList = nuBaseInfoService.qyList(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
@ -91,7 +105,7 @@ public class NuBaseInfoController extends JeecgController<NuBaseInfo, INuBaseInf
@RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST})
public Result<String> edit(@RequestBody NuBaseInfo nuBaseInfo) {
nuBaseInfoService.updateById(nuBaseInfo);
return Result.OK("编辑成功!");
return Result.OK("操作成功!");
}
/**

View File

@ -1,9 +1,6 @@
package com.nu.modules.nuBaseInfo.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@ -83,4 +80,19 @@ public class NuBaseInfo implements Serializable {
/**是否已同步0已同步 1未同步*/
@ApiModelProperty(value = "是否已同步0已同步 1未同步")
private java.lang.String izSync;
@TableField(exist = false)
private String deviceId;//摄像头 ID
@TableField(exist = false)
private String deviceName;//摄像头名称
@TableField(exist = false)
private String deviceStatus;//摄像头状态
@TableField(exist = false)
private String deviceMac;//摄像头状态
@TableField(exist = false)
private int streamType;
@TableField(exist = false)
private String deviceIndex;
}

View File

@ -22,4 +22,6 @@ public interface NuBaseInfoMapper extends BaseMapper<NuBaseInfo> {
String getNuId();
IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page,@Param(Constants.WRAPPER) QueryWrapper<NuBaseInfoApiDto> queryWrapper);
IPage<NuBaseInfo> qyList(Page<NuBaseInfo> page, @Param(Constants.WRAPPER) QueryWrapper<NuBaseInfo> queryWrapper);
}

View File

@ -12,4 +12,12 @@
select * from nu_base_info
${ew.customSqlSegment}
</select>
<select id="qyList" resultType="com.nu.modules.nuBaseInfo.entity.NuBaseInfo">
select a.*,b.id as camera_id,b.device_name,b.device_status,REPLACE(b.mac,'-','') as device_mac,0 as streamType,b.device_index
from nu_base_info a
left join nu_iot_tplink_camera b on a.nu_id = b.nu_id
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -1,5 +1,8 @@
package com.nu.modules.nuBaseInfo.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.nu.modules.nuBaseInfo.entity.NuBaseInfo;
@ -18,4 +21,6 @@ public interface INuBaseInfoService extends IService<NuBaseInfo> {
List<NuBaseInfo> getSynchronized(String dataSourceCode,String orgCode);
void batchInsert(List<NuBaseInfo> syncList);
IPage<NuBaseInfo> qyList(Page<NuBaseInfo> page, QueryWrapper<NuBaseInfo> queryWrapper);
}

View File

@ -84,6 +84,11 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
});
}
@Override
public IPage<NuBaseInfo> qyList(Page<NuBaseInfo> page, QueryWrapper<NuBaseInfo> queryWrapper) {
return baseMapper.qyList(page,queryWrapper);
}
@Override
public void save(NuBaseInfoApiDto dto) {
NuBaseInfo nuBaseInfo = new NuBaseInfo();