@LazyRepositorypublicinterfaceSysMenuLazyJpaRepositoryextendsLazyJpaRepository<SysMenu,Integer>{// 自定义查询@LazySelect("select * from sys_menu where parent_id={parentId}")List<SysMenu>findListByParentId(Integer parentId);@LazySelect("select * from sys_menu where id ={id}")SysMenufindMenuById(@LazyParam("id")Integer menuId);@LazySelect("select * from sys_menu where id ={id}")List<Map<?,?>>findListMapByParentId(@LazyParam("id")Integer menuId);@LazyInsert("INSERT Ignore INTO `sys_menu` ( `id`, `name`, `url`, `icon`, `parent_id`,`parent_name`,`sort`,`status`) VALUES ({id},{name},{url},{icon},{parentId},{parentName},{sort},{status});")voidinsert(Integer id,String name,String url,String icon,Integer parentId,String parentName,Integer sort,Integer status
);@LazyUpdate("UPDATE `sys_menu` SET `name` = {name} WHERE `id` = {id};")voidupdateNameById(Integer id,String name);@LazyDelete("DELETE FROM sys_menu WHERE `id` = {id};")voidremoveById(int id);/**
* 执行sql select * from sys_menu where id={id}
* 根据ID获取数据
* @param id 数据ID
*/SysMenufindById(int id);/**
* 执行sql select id,name,url,icon from sys_menu where id={id}
* 获取ID、名称、url、icon
* @param id 主键ID
* @return 查询信息
*/SysMenufindIdAndNameAndUrlAndIconById(int id);}