//package cn.iocoder.yudao.module.system.framework.datapermission.core;
//
//import cn.iocoder.yudao.framework.datapermission.core.rule.DataPermissionRule;
//import cn.iocoder.yudao.framework.mybatis.core.util.MyBatisUtils;
//import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
//import com.google.common.collect.Sets;
//import net.sf.jsqlparser.expression.Alias;
//import net.sf.jsqlparser.expression.Expression;
//import net.sf.jsqlparser.expression.LongValue;
//import net.sf.jsqlparser.expression.operators.relational.EqualsTo;
//import org.springframework.stereotype.Component;
//
//import java.util.Set;
//
//@Component
//public class DemoDataPermissionRule implements DataPermissionRule {
//    public Set<String> getTableNames(){
//        return Sets.newHashSet("trs_harmful_info_report");
//    }
//    public Expression getExpression(String tableName, Alias tableAlias) {
//        Long deptId = SecurityFrameworkUtils.getLoginUserDeptId();
//        assert deptId != null;
//        switch (tableName) {
//            case "trs_harmful_info_report":
//                return new EqualsTo(MyBatisUtils.buildColumn(tableName, tableAlias, "department_id"),new LongValue(deptId));
//            default:
//                return null;
//        }
//    }
//}
