字典移动到mall,增加根据名称查询字典的方法
This commit is contained in:
@ -0,0 +1,49 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("dict")
|
||||
public class Dict extends BaseDomain {
|
||||
|
||||
/** 字典ID */
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 字典名称 */
|
||||
@NotBlank(message = "字典名称不能为空")
|
||||
private String name;
|
||||
|
||||
|
||||
/** 描述 */
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
|
||||
public void copy(Dict source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
@ -0,0 +1,56 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.domain;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import co.yixiang.domain.BaseDomain;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
@TableName("dict_detail")
|
||||
public class DictDetail extends BaseDomain {
|
||||
|
||||
/** 字典详细 */
|
||||
@TableId
|
||||
private Long id;
|
||||
|
||||
|
||||
/** 字典标签 */
|
||||
private String label;
|
||||
|
||||
|
||||
/** 字典值 */
|
||||
private String value;
|
||||
|
||||
|
||||
/** 排序 */
|
||||
private String sort;
|
||||
|
||||
|
||||
/** 字典id */
|
||||
private Long dictId;
|
||||
|
||||
@TableField(exist = false)
|
||||
private Dict dict;
|
||||
|
||||
|
||||
|
||||
|
||||
public void copy(DictDetail source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service;
|
||||
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.dict.domain.DictDetail;
|
||||
import co.yixiang.modules.dict.service.dto.DictDetailDto;
|
||||
import co.yixiang.modules.dict.service.dto.DictDetailQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
public interface DictDetailService extends BaseService<DictDetail>{
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(DictDetailQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<DictDetailDto>
|
||||
*/
|
||||
List<DictDetail> queryAll(DictDetailQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<DictDetailDto> all, HttpServletResponse response) throws IOException;
|
||||
|
||||
|
||||
/**
|
||||
* 按名称查询字典值返回label
|
||||
*
|
||||
* @param dictName dict类型名称
|
||||
* @return {@link Map}<{@link String}, {@link String}>
|
||||
*/
|
||||
Map<String, String> queryDetailsByName(String dictName);
|
||||
|
||||
/**
|
||||
* 按名称查询字典值返回key
|
||||
*
|
||||
* @param dictName dict类型名称
|
||||
* @return {@link Map}<{@link String}, {@link String}>
|
||||
*/
|
||||
Map<String, String> queryDetailsByKey(String dictName);
|
||||
|
||||
}
|
@ -0,0 +1,50 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service;
|
||||
|
||||
import co.yixiang.common.service.BaseService;
|
||||
import co.yixiang.modules.dict.domain.Dict;
|
||||
import co.yixiang.modules.dict.service.dto.DictDto;
|
||||
import co.yixiang.modules.dict.service.dto.DictQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
public interface DictService extends BaseService<Dict>{
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(DictQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<DictDto>
|
||||
*/
|
||||
List<Dict> queryAll(DictQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<DictDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
public class DictDetailDto implements Serializable {
|
||||
|
||||
/** 字典详细 */
|
||||
private Long id;
|
||||
|
||||
/** 字典标签 */
|
||||
private String label;
|
||||
|
||||
/** 字典值 */
|
||||
private String value;
|
||||
|
||||
/** 排序 */
|
||||
private String sort;
|
||||
|
||||
/** 字典id */
|
||||
private Long dictId;
|
||||
|
||||
/** 创建日期 */
|
||||
private Timestamp createTime;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.dto;
|
||||
|
||||
import co.yixiang.annotation.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
public class DictDetailQueryCriteria{
|
||||
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String label;
|
||||
|
||||
private String dictName;
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
public class DictDto implements Serializable {
|
||||
|
||||
/** 字典ID */
|
||||
private Long id;
|
||||
|
||||
/** 字典名称 */
|
||||
private String name;
|
||||
|
||||
private List<DictDetailDto> dictDetails;
|
||||
|
||||
/** 描述 */
|
||||
private String remark;
|
||||
|
||||
/** 创建日期 */
|
||||
private Timestamp createTime;
|
||||
}
|
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.dto;
|
||||
|
||||
import co.yixiang.annotation.Query;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Data
|
||||
public class DictQueryCriteria{
|
||||
|
||||
@Query(blurry = "name,remark")
|
||||
private String blurry;
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.impl;
|
||||
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.modules.dict.domain.DictDetail;
|
||||
import co.yixiang.modules.dict.service.DictDetailService;
|
||||
import co.yixiang.modules.dict.service.dto.DictDetailDto;
|
||||
import co.yixiang.modules.dict.service.dto.DictDetailQueryCriteria;
|
||||
import co.yixiang.modules.dict.service.mapper.DictDetailMapper;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
//@CacheConfig(cacheNames = "dictDetail")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class DictDetailServiceImpl extends BaseServiceImpl<DictDetailMapper, DictDetail> implements DictDetailService {
|
||||
|
||||
private final IGenerator generator;
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(DictDetailQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<DictDetail> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), DictDetailDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public List<DictDetail> queryAll(DictDetailQueryCriteria criteria){
|
||||
List<DictDetail> list = baseMapper.selectDictDetailList(criteria.getLabel(),criteria.getDictName());
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(List<DictDetailDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (DictDetailDto dictDetail : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("字典标签", dictDetail.getLabel());
|
||||
map.put("字典值", dictDetail.getValue());
|
||||
map.put("排序", dictDetail.getSort());
|
||||
map.put("字典id", dictDetail.getDictId());
|
||||
map.put("创建日期", dictDetail.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> queryDetailsByName(String dictName) {
|
||||
List<DictDetailDto> dtoList = getDictDetailDtos(dictName);
|
||||
return dtoList.stream().collect(Collectors.toMap(DictDetailDto::getValue, DictDetailDto::getLabel));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, String> queryDetailsByKey(String dictName) {
|
||||
List<DictDetailDto> dtoList = getDictDetailDtos(dictName);
|
||||
return dtoList.stream().collect(Collectors.toMap(DictDetailDto::getLabel, DictDetailDto::getValue));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取dictDetailDto列表
|
||||
*
|
||||
* @param dictName dict类型名称
|
||||
* @return {@link List}<{@link DictDetailDto}>
|
||||
*/
|
||||
private List<DictDetailDto> getDictDetailDtos(String dictName) {
|
||||
DictDetailQueryCriteria criteria =new DictDetailQueryCriteria();
|
||||
criteria.setDictName(dictName);
|
||||
List<DictDetail> list = baseMapper.selectDictDetailList(criteria.getLabel(),criteria.getDictName());
|
||||
return generator.convert(list, DictDetailDto.class);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,98 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import co.yixiang.common.service.impl.BaseServiceImpl;
|
||||
import co.yixiang.common.utils.QueryHelpPlus;
|
||||
import co.yixiang.dozer.service.IGenerator;
|
||||
import co.yixiang.modules.dict.domain.Dict;
|
||||
import co.yixiang.modules.dict.service.DictService;
|
||||
import co.yixiang.modules.dict.service.dto.DictDetailDto;
|
||||
import co.yixiang.modules.dict.service.dto.DictDto;
|
||||
import co.yixiang.modules.dict.service.dto.DictQueryCriteria;
|
||||
import co.yixiang.modules.dict.service.mapper.DictMapper;
|
||||
import co.yixiang.utils.FileUtil;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import lombok.AllArgsConstructor;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
// 默认不使用缓存
|
||||
//import org.springframework.cache.annotation.CacheConfig;
|
||||
//import org.springframework.cache.annotation.CacheEvict;
|
||||
//import org.springframework.cache.annotation.Cacheable;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Service
|
||||
@AllArgsConstructor
|
||||
//@CacheConfig(cacheNames = "dict")
|
||||
@Transactional(propagation = Propagation.SUPPORTS, readOnly = true, rollbackFor = Exception.class)
|
||||
public class DictServiceImpl extends BaseServiceImpl<DictMapper, Dict> implements DictService {
|
||||
|
||||
private final IGenerator generator;
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public Map<String, Object> queryAll(DictQueryCriteria criteria, Pageable pageable) {
|
||||
getPage(pageable);
|
||||
PageInfo<Dict> page = new PageInfo<>(queryAll(criteria));
|
||||
Map<String, Object> map = new LinkedHashMap<>(2);
|
||||
map.put("content", generator.convert(page.getList(), DictDto.class));
|
||||
map.put("totalElements", page.getTotal());
|
||||
return map;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
//@Cacheable
|
||||
public List<Dict> queryAll(DictQueryCriteria criteria){
|
||||
return baseMapper.selectList(QueryHelpPlus.getPredicate(Dict.class, criteria));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void download(List<DictDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (DictDto dict : all) {
|
||||
if(CollectionUtil.isNotEmpty(dict.getDictDetails())){
|
||||
for (DictDetailDto dictDetail : dict.getDictDetails()) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("字典名称", dict.getName());
|
||||
map.put("字典描述", dict.getRemark());
|
||||
map.put("字典标签", dictDetail.getLabel());
|
||||
map.put("字典值", dictDetail.getValue());
|
||||
map.put("创建日期", dictDetail.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
} else {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("字典名称", dict.getName());
|
||||
map.put("字典描述", dict.getRemark());
|
||||
map.put("字典标签", null);
|
||||
map.put("字典值", null);
|
||||
map.put("创建日期", dict.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.dict.domain.DictDetail;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
public interface DictDetailMapper extends CoreMapper<DictDetail> {
|
||||
|
||||
@Select("<script>SELECT d.* from dict_detail d LEFT JOIN dict t on d.dict_id = t.id where 1=1 <if test = \"label !=null\" > and d.label LIKE concat('%', #{label}, '%') </if> <if test = \"dictName != ''||dictName !=null\" > AND t.name = #{dictName} order by d.sort asc</if></script>")
|
||||
List<DictDetail> selectDictDetailList(@Param("label") String label,@Param("dictName") String dictName);
|
||||
}
|
@ -0,0 +1,22 @@
|
||||
/**
|
||||
* Copyright (C) 2018-2022
|
||||
* All rights reserved, Designed By www.yixiang.co
|
||||
* 注意:
|
||||
* 本软件为www.yixiang.co开发研制,未经购买不得使用
|
||||
* 购买后可获得全部源代码(禁止转卖、分享、上传到码云、github等开源平台)
|
||||
* 一经发现盗用、分享等行为,将追究法律责任,后果自负
|
||||
*/
|
||||
package co.yixiang.modules.dict.service.mapper;
|
||||
|
||||
import co.yixiang.common.mapper.CoreMapper;
|
||||
import co.yixiang.modules.dict.domain.Dict;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* @author hupeng
|
||||
* @date 2020-05-14
|
||||
*/
|
||||
@Repository
|
||||
public interface DictMapper extends CoreMapper<Dict> {
|
||||
|
||||
}
|
Reference in New Issue
Block a user