package com.yh.saas.plugin.yiliangyiyun.service.impl;

import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.toolkit.CollectionUtils;
import com.winsea.svc.base.base.entity.CommonStaff;
import com.winsea.svc.base.base.service.ICommonStaffService;
import com.yh.saas.plugin.yiliangyiyun.entity.CommonSysParameter;
import com.yh.saas.plugin.yiliangyiyun.mapper.CommonSysParameterMapper;
import com.yh.saas.plugin.yiliangyiyun.service.ICommonSysParameterService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.yh.saas.toolkit.workflow.service.IWorkflowService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 记录系统用到的变量 服务实现类
 * </p>
 *
 * @author Gongdc
 * @since 2021-05-18
 */
@Service
public class CommonSysParameterServiceImpl extends ServiceImpl<CommonSysParameterMapper, CommonSysParameter> implements ICommonSysParameterService {

    @Autowired
    private ICommonStaffService commonStaffService;

    /**
     * 查询
     * @param constId
     * @return
     */
    @Override
    public List<CommonSysParameter> getInfo(String constId){
        List<CommonSysParameter> commonSysParameterList = this.selectList(new EntityWrapper<CommonSysParameter>()
        .eq(CommonSysParameter.QueryFiles.CONST_ID,constId).orderBy(CommonSysParameter.QueryFiles.SORT));
        return commonSysParameterList;
    }


    /**
     * 查询
     * @param roleId
     * @return
     */
    @Override
    public List<CommonStaff> getStaffInfo(String roleId){
        List<CommonStaff> commonStaffs = commonStaffService.selectList(new EntityWrapper<CommonStaff>()
                .eq("major_role_id",roleId));
        return commonStaffs;
    }
}
