| | |
| | | } |
| | | |
| | | /** |
| | | * 获取字典-微信小程序 |
| | | */ |
| | | @GetMapping("/dictionary_wx") |
| | | @ApiOperationSupport(order = 10) |
| | | @ApiOperation(value = "获取字典", notes = "获取字典") |
| | | public R<List<DictBiz>> dictionaryWx(String code,String tenantId) { |
| | | List<DictBiz> tree = dictService.getListWx(code,tenantId); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典树 |
| | | */ |
| | | @GetMapping("/dictionary-tree") |
| | |
| | | package org.springblade.modules.system.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.system.entity.DictBiz; |
| | | import org.springblade.modules.system.vo.DictBizVO; |
| | | |
| | |
| | | */ |
| | | List<DictBizVO> parentTree(); |
| | | |
| | | /** |
| | | * 获取字典-微信小程序 |
| | | * @param code |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListWx(@Param("code") String code,@Param("tenantId") String tenantId); |
| | | } |
| | |
| | | select id, parent_id, dict_value as title, id as "value", id as "key" from blade_dict_biz where is_deleted = 0 and parent_id = 0 |
| | | </select> |
| | | |
| | | <!--获取字典-微信小程序--> |
| | | <select id="getListWx" resultMap="dictResultMap"> |
| | | select id, parent_id, code, dict_key, dict_value, sort, remark from blade_dict_biz |
| | | where code = #{code} and tenant_id = #{tenantId} |
| | | and parent_id > 0 and is_sealed = 0 and is_deleted = 0 |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | */ |
| | | List<DictBizVO> childList(Map<String, Object> dict, Long parentId); |
| | | |
| | | /** |
| | | * 获取字典-微信小程序 |
| | | * @param code |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | List<DictBiz> getListWx(String code, String tenantId); |
| | | } |
| | |
| | | List<DictBiz> list = this.list(Condition.getQueryWrapper(dict, DictBiz.class).lambda().ne(DictBiz::getId, parentId).eq(DictBiz::getCode, parentDict.getCode()).orderByAsc(DictBiz::getSort)); |
| | | return DictBizWrapper.build().listNodeVO(list); |
| | | } |
| | | |
| | | /** |
| | | * 获取字典-微信小程序 |
| | | * @param code |
| | | * @param tenantId |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<DictBiz> getListWx(String code, String tenantId) { |
| | | return baseMapper.getListWx(code,tenantId); |
| | | } |
| | | } |