use of tk.mybatis.mapper.entity.Example in project paascloud-master by paascloud.
the class UacMenuCommonController method checkUacMenuUrl.
/**
* 检测菜单URL唯一性
*
* @param uacMenuCheckUrlDto the uac menu check url dto
*
* @return the wrapper
*/
@PostMapping(value = "/checkMenuUrl")
@ApiOperation(httpMethod = "POST", value = "检测菜单URL唯一性")
public Wrapper<Boolean> checkUacMenuUrl(@ApiParam(name = "uacMenuCheckUrlDto", value = "id与url") @RequestBody UacMenuCheckUrlDto uacMenuCheckUrlDto) {
logger.info("检测菜单URL唯一性 uacMenuCheckUrlDto={}", uacMenuCheckUrlDto);
Long id = uacMenuCheckUrlDto.getMenuId();
String url = uacMenuCheckUrlDto.getUrl();
Example example = new Example(UacMenu.class);
Example.Criteria criteria = example.createCriteria();
if (id != null) {
criteria.andNotEqualTo("id", id);
}
criteria.andEqualTo("url", url);
int result = uacMenuService.selectCountByExample(example);
return WrapMapper.ok(result < 1);
}
Aggregations