package com.baichuanxin.openrestapi.service.impl;

import com.baichuanxin.openrestapi.dao.mapper.NationDicMapper;
import com.baichuanxin.openrestapi.entity.NationDic;
import com.baichuanxin.openrestapi.service.NationDicService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

@Service
public class NationDicServiceImpl extends ServiceImpl<NationDicMapper, NationDic>  implements NationDicService {
    @Override
    public String getValue(String key) {
        QueryWrapper<NationDic> queryWrapper = new QueryWrapper();
        queryWrapper.eq("item_key",key);
        NationDic one = this.getOne(queryWrapper);

        if (one != null){
            return one.getItemValue();
        }else  return "0";
    }
}
