{
@Autowired
private IMbblabelidvService mbblabelidvService;
/**
* 查询MBBLABELIDV列表
*/
@PreAuthorize("@ss.hasPermi('baseinfo:mbblabelidv:list')")
@GetMapping("/list")
public TableDataInfo list(Mbblabelidv mbblabelidv)
{
startPage();
List<Mbblabelidv> list = mbblabelidvService.selectMbblabelidvList(mbblabelidv);
System.out.println(true);
return getDataTable(list);
}
/**
* 导出MBBLABELIDV列表
*/
@PreAuthorize("@ss.hasPermi('baseinfo:mbblabelidv:export')")
@Log(title = "MBBLABELIDV", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, Mbblabelidv mbblabelidv)
{
List<Mbblabelidv> list = mbblabelidvService.selectMbblabelidvList(mbblabelidv);
ExcelUtil<Mbblabelidv> util = new ExcelUtil<Mbblabelidv>(Mbblabelidv.class);
util.exportExcel(response, list, "MBBLABELIDV数据");
}
/**
* 获取MBBLABELIDV详细信息
*/
@PreAuthorize("@ss.hasPermi('baseinfo:mbblabelidv:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(mbblabelidvService.selectMbblabelidvById(id));
}
在controller中添加一个方法,代码如下;如果对你有所帮助望采纳
```java
/**
* id 对应1010,code对应BL4096
*/
@PreAuthorize("xxxxxx") //xxxxxx换成实际权限
@GetMapping(value = "/xxx") //xxx换成实际映射
public boolean getTrueOrFalse(String id,String code)
{
String dbId = mbblabelidvService.getId(id);
if(StringUtils.isEmpty(dbId)){
return false;
}
String dbCode = mbblabelidvService.getCode(id);
if(StringUtils.isEmpty(dbCode)){
return false;
}
return true;
}
```
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(service接口);
}
可以模仿这个接口,service接口返回值定义成Boolean类型
类似于这种:
@GetMapping(value = "/{id}/{code}")
public AjaxResult getInfo(@PathVariable("id") Long id,@PathVariable("code") String code)
{
boolean result = mbblabelidvService.checkIdAndCode(id,code);
return AjaxResult.success(result);
}
https://blog.csdn.net/weixin_38657051/article/details/90018814