添加pad接口

This commit is contained in:
yangjun 2025-07-25 14:20:32 +08:00
parent 592d0d1f75
commit d6f5fe3bf8
5 changed files with 54 additions and 4 deletions

View File

@ -14,4 +14,8 @@ public interface INuBaseInfoApi {
void sync();
IPage<NuBaseInfoApiDto> queryPadPageList(Page<NuBaseInfoApiDto> page, QueryWrapper<NuBaseInfoApiDto> queryWrapper);
NuBaseInfoApiDto queryinfoByBuId(QueryWrapper<NuBaseInfoApiDto> queryWrapper);
int updateBaseInfo(NuBaseInfoApiDto nuBaseInfoApiDto);
}

View File

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

View File

@ -20,4 +20,9 @@
left join nu_iot_tplink_camera b on a.nu_id = b.nu_id
${ew.customSqlSegment}
</select>
<select id="queryinfoByBuId" resultType="com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto">
select * from nu_base_info
${ew.customSqlSegment}
</select>
</mapper>

View File

@ -121,4 +121,16 @@ public class NuBaseInfoServiceImpl extends ServiceImpl<NuBaseInfoMapper, NuBaseI
});
return list;
}
@Override
public NuBaseInfoApiDto queryinfoByBuId(QueryWrapper<NuBaseInfoApiDto> queryWrapper) {
return baseMapper.queryinfoByBuId(queryWrapper);
}
@Override
public int updateBaseInfo(NuBaseInfoApiDto nuBaseInfoApiDto) {
NuBaseInfo baseInfo = new NuBaseInfo();
BeanUtils.copyProperties(nuBaseInfoApiDto,baseInfo);
return baseMapper.updateById(baseInfo);
}
}

View File

@ -6,14 +6,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.nu.modules.nubaseinfo.api.INuBaseInfoApi;
import com.nu.modules.nubaseinfo.entity.NuBaseInfoApiDto;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang.StringUtils;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.aspect.annotation.AutoLog;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.query.QueryRuleEnum;
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.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;
@ -40,5 +39,33 @@ public class BaseInfoApi {
return Result.OK(pageList);
}
@ApiOperation(value = "ipad-根据护理单元NUID查询数据", notes = "ipad-根据护理单元NUID查询数据")
@GetMapping(value = "/queryinfoByBuId")
public Result<NuBaseInfoApiDto> queryinfoByBuId(NuBaseInfoApiDto nuBaseInfoApiDto, HttpServletRequest req) {
if(StringUtils.isBlank(nuBaseInfoApiDto.getNuId())){
return Result.error("请填写NUID");
}
Map<String, QueryRuleEnum> customeRuleMap = new HashMap<>();
QueryWrapper<NuBaseInfoApiDto> queryWrapper = QueryGenerator.initQueryWrapper(nuBaseInfoApiDto, req.getParameterMap(), customeRuleMap);
NuBaseInfoApiDto dto = iNuBaseInfoApi.queryinfoByBuId( queryWrapper);
if(dto == null ){
return Result.error("未查询到数据");
}
return Result.OK(dto);
}
@AutoLog(value = "ipad-护理单元-编辑")
@ApiOperation(value = "ipad-护理单元-编辑", notes = "ipad-护理单元-编辑")
@PostMapping(value = "/updateBaseInfo")
public Result<String> updateBaseInfo(@RequestBody NuBaseInfoApiDto nuBaseInfoApiDto) {
int dto = iNuBaseInfoApi.updateBaseInfo(nuBaseInfoApiDto);
if(dto>0){
return Result.OK("操作成功");
}else{
return Result.OK("操作失败");
}
}
}