获取字典类型详情

pull/3/head
huangyao 2021-01-10 18:28:20 +08:00
parent 50c0557585
commit 2a3251ffe2
5 changed files with 49 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package cn.stylefeng.roses.kernel.dict.modular.controller;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.dict.modular.pojo.request.DictTypeRequest;
import cn.stylefeng.roses.kernel.dict.modular.service.DictTypeService;
@ -13,6 +14,7 @@ import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@ -79,6 +81,12 @@ public class DictTypeController {
return new SuccessResponseData();
}
@GetResource(name = "获取字典类型详情", path = "/dictType/getDictDetail", requiredPermission = false)
public ResponseData getDictDetail(@RequestParam("dictTypeId") Long dictTypeId) {
SysDictType detail = this.dictTypeService.findDetail(dictTypeId);
return new SuccessResponseData(detail);
}
/**
*
*

View File

@ -1,5 +1,6 @@
package cn.stylefeng.roses.kernel.dict.modular.mapper;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.dict.modular.pojo.request.DictTypeRequest;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@ -16,6 +17,16 @@ import java.util.List;
*/
public interface DictTypeMapper extends BaseMapper<SysDictType> {
/**
*
*
* @param dictTypeId id
* @return
* @author huangyao
* @date 2021/1/10 17:25
*/
SysDictType findDetail(@Param("dictTypeId") Long dictTypeId);
/**
*
*

View File

@ -2,6 +2,21 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.stylefeng.roses.kernel.dict.modular.mapper.DictTypeMapper">
<select id="findDetail" resultType="cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType" parameterType="long">
SELECT dict_type_id AS dictTypeId,
dict_type_class AS dictTypeClass,
dict_type_bus_code AS dictTypeBusCode,
dict_type_code AS dictTypeCode,
dict_type_name AS dictTypeName,
dict_type_name_pinyin AS dictTypeNamePinyin,
dict_type_desc AS dictTypeDesc,
status_flag AS statusFlag,
dict_type_sort AS dictTypeSort
FROM sys_dict_type
WHERE del_flag = 'N'
AND dict_type_id = #{dictTypeId}
</select>
<!--查询字典类型列表-->
<select id="findList" resultType="cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType">
SELECT dict_type_id AS dictTypeId,

View File

@ -2,6 +2,7 @@ package cn.stylefeng.roses.kernel.dict.modular.service;
import cn.stylefeng.roses.kernel.db.api.pojo.page.PageResult;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDict;
import cn.stylefeng.roses.kernel.dict.modular.entity.SysDictType;
import cn.stylefeng.roses.kernel.dict.modular.pojo.request.DictTypeRequest;
import com.baomidou.mybatisplus.extension.service.IService;
@ -82,4 +83,13 @@ public interface DictTypeService extends IService<SysDictType> {
*/
boolean validateCodeAvailable(DictTypeRequest dictTypeRequest);
/**
*
*
* @param dictTypeId id
* @return
* @author huangyao
* @date 2021/1/10 17:27
*/
SysDictType findDetail(Long dictTypeId);
}

View File

@ -170,6 +170,11 @@ public class DictTypeServiceImpl extends ServiceImpl<DictTypeMapper, SysDictType
return selectCount <= 0;
}
@Override
public SysDictType findDetail(Long dictTypeId) {
return this.baseMapper.findDetail(dictTypeId);
}
/**
* dictTypeClass
*