package org.jeecg.common.system.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.jeecg.common.system.entity.SysDepart;
import org.jeecg.common.system.entity.SysDict;
import org.jeecg.common.system.entity.SysPermissionDataRule;
import org.jeecg.common.system.entity.SysUser;
import org.jeecg.common.system.vo.DictModel;

import java.util.List;

/**
 * <p>
 * 字典表 Mapper 接口
 * </p>
 *
 * @Author zhangweijian
 * @since 2018-12-28
 */
public interface CoreMapper extends BaseMapper<SysDict> {
	//1
	String queryDictTextByKey(@Param("code") String code,@Param("key") String key,@Param("extendsKey") String extendsKey,@Param("extendsValue")String extendsValue);
	//2
	String queryTableDictTextByKey(@Param("table") String table,@Param("text") String text,@Param("code") String code,@Param("key") String key,@Param("extendsKey") String extendsKey,@Param("extendsValue")String extendsValue);

	SysUser getUserByName(@Param("username")String username);

	List<SysDepart> queryUserDeparts(@Param("userId")String id);

	List<String> queryDataRuleIds(@Param("username") String username,@Param("permissionId") String permissionId);

	List<DictModel> queryDictItemsByCode(@Param("code")String code);

	List<SysPermissionDataRule> selectSysPermissionDataRuleList(@Param("idList") List<String> idList, @Param("status") int status);

	List<DictModel> queryTableDictItemsByCode(@Param("table")String dicTable, @Param("text")String dicText, @Param("code")String dicCode);
}
