package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.module.jxiop.biz.entity.TpriDmpDatabook;
import com.yeejoin.amos.boot.module.jxiop.biz.mapper2.TpriDmpDatabookMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 数据字典表服务实现类
 *
 * @author system_generator
 * @date 2023-07-03
 */
@Service
public class TpriDmpDatabookServiceImpl {
    @Autowired
    TpriDmpDatabookMapper tpriDmpDatabookMapper;

    /**
     * @deprecated  获取字典参数列表
     * @parsm null
     * @return List<TpriDmpDatabook> 所有的数字列表项
     */
    public List<TpriDmpDatabook> getTpriDmpDatabookList() {
        List<TpriDmpDatabook> tpriDmpDatabookList = new ArrayList<>();
        tpriDmpDatabookList = this.tpriDmpDatabookMapper.selectList(new QueryWrapper<TpriDmpDatabook>().isNotNull("DATAID"));
        return tpriDmpDatabookList;
    }

    /**
     * @deprecated 根据数据字典名称查询字典项
     * @param dataName 字典名称
     * @return  TpriDmpDatabook实体
     */
    public TpriDmpDatabook getTpriDmpDatabookByDataName(String dataName){
        TpriDmpDatabook tpriDmpDatabook = new TpriDmpDatabook();
        tpriDmpDatabook  = this.tpriDmpDatabookMapper.selectOne(new QueryWrapper<TpriDmpDatabook>().eq("DATANAME",dataName));
        return  tpriDmpDatabook;
    }
}