huanghongfa
2021-07-05 2dcf4b9d75cc1b6613aea59cec4a0f9cc97f1c0e
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/BcDictionaryServiceImpl.java
@@ -1,12 +1,14 @@
package com.panzhihua.service_community.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.panzhihua.common.model.vos.BcDictionaryItemVO;
import com.panzhihua.common.model.vos.BcDictionaryVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.utlis.CopyUtil;
import com.panzhihua.service_community.dao.BcDictionaryItemDAO;
import com.panzhihua.service_community.model.dos.BcDictionaryItemDO;
import com.panzhihua.service_community.service.BcDictionaryService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
@@ -33,4 +35,17 @@
        }
        return R.ok(listVO);
    }
    @Override
    public BcDictionaryItemVO getByCode(String dictId, String code) {
        BcDictionaryItemDO dictionaryItemDO = baseMapper.selectOne(
                new QueryWrapper<BcDictionaryItemDO>()
                        .eq("dict_id", dictId)
                        .eq("dict_value", code)
        );
        if (dictionaryItemDO != null) {
            return CopyUtil.copyProperties(dictionaryItemDO, BcDictionaryItemVO.class);
        }
        return null;
    }
}