package com.sckw.system.repository;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sckw.core.model.base.BaseModel;
import com.sckw.system.dao.KwsRoleDao;
import com.sckw.system.model.KwsRole;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author :chenXiaoFei
 * @version :1.0
 * @description : 角色信息
 * @create :2025-11-04 18:23:00
 */
@Repository
public class KwsRoleRepository extends ServiceImpl<KwsRoleDao, KwsRole> {
    /**
     * 根据企业id查询角色信息
     * @param entId 企业id
     * @return 角色信息
     */
    public List<KwsRole> queryByEntId(String entId) {
        return list(Wrappers.<KwsRole>lambdaQuery()
                .eq(KwsRole::getEntId,entId)
                .eq(BaseModel::getDelFlag,0));
    }

    public List<KwsRole> queryByEntId(Long entId) {
        return list(Wrappers.<KwsRole>lambdaQuery()
                .eq(KwsRole::getEntId,entId)
                .eq(BaseModel::getDelFlag,0));
    }
}
