| @@ -56,6 +56,18 @@ public class AssetIconController { | |||||
| return AjaxResult.success(this.assetIconService.queryById(id)); | return AjaxResult.success(this.assetIconService.queryById(id)); | ||||
| } | } | ||||
| /** | |||||
| * 通过主键查询单条数据 | |||||
| * | |||||
| * @param categoryId 主键 | |||||
| * @return 单条数据 | |||||
| */ | |||||
| @GetMapping("category/{id}") | |||||
| @ApiOperation("根据图标类别id查询") | |||||
| public AjaxResult queryByCategoryId(@PathVariable("id") Integer categoryId) { | |||||
| return AjaxResult.success(this.assetIconService.queryByCategoryId(categoryId)); | |||||
| } | |||||
| /** | /** | ||||
| * 按图标名字模糊查询 | * 按图标名字模糊查询 | ||||
| * | * | ||||
| @@ -81,5 +81,8 @@ public interface AssetIconDao { | |||||
| List<AssetIcon> queryByName(String name); | List<AssetIcon> queryByName(String name); | ||||
| List<AssetIcon> queryByCategoryId(Integer categoryId); | |||||
| } | } | ||||
| @@ -59,4 +59,5 @@ public interface AssetIconService { | |||||
| List<AssetIcon> queryByName(String name); | List<AssetIcon> queryByName(String name); | ||||
| List<AssetIcon> queryByCategoryId(Integer categoryId); | |||||
| } | } | ||||
| @@ -120,4 +120,9 @@ public class AssetIconServiceImpl implements AssetIconService { | |||||
| public List<AssetIcon> queryByName(String name) { | public List<AssetIcon> queryByName(String name) { | ||||
| return this.assetIconDao.queryByName(name); | return this.assetIconDao.queryByName(name); | ||||
| } | } | ||||
| @Override | |||||
| public List<AssetIcon> queryByCategoryId(Integer categoryId) { | |||||
| return this.assetIconDao.queryByCategoryId(categoryId); | |||||
| } | |||||
| } | } | ||||
| @@ -23,6 +23,13 @@ | |||||
| where id = #{id} and state = 1 | where id = #{id} and state = 1 | ||||
| </select> | </select> | ||||
| <select id="queryByCategoryId" resultMap="AssetIconMap"> | |||||
| select | |||||
| id,name, category_id, path, description, create_by, create_time, update_by, update_time, state | |||||
| from asset_icon | |||||
| where category_id = #{categoryId} and state = 1 | |||||
| </select> | |||||
| <!--通过图标名字进行模糊查询--> | <!--通过图标名字进行模糊查询--> | ||||
| <select id="queryByName" resultMap="AssetIconMap"> | <select id="queryByName" resultMap="AssetIconMap"> | ||||
| select | select | ||||