package com.chaozhanggui.admin.system.service;

import com.chaozhanggui.common.system.config.RespBody;
import com.chaozhanggui.dao.system.dao.TbPlussDictMapper;
import com.chaozhanggui.dao.system.entity.TbPlussDict;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author lyf
 */
@Service
@Slf4j
public class DictService {
    @Resource
    private TbPlussDictMapper dictMapper;
    public RespBody getGroupByCode(String code){
        TbPlussDict dict = dictMapper.selectByCode(code);
        if (dict == null){
            log.error("对应字典项不匹配");
            return new RespBody("000070");
        }
        List<TbPlussDict> dictsList = dictMapper.selectByPId(dict.getId());
        return new RespBody("000000",dictsList);
    }
}
