1.普通方式
mybatis-plus.configuration.variables.secretFilterSwitch=0
yml的方式

mybatis:
mapper-locations: classpath:mapper/*.xml
type-aliases-package: com.demo
configuration:
variables:
userId: 456132465
userName: 李四
配置完成后在代码中调用

@Override
public void add1() {
String s1="abc";
String s2="abcc";
dictMapper.add1(s1,s2);
}


<select id="add1" resultType="com.atguigu.yygh.cmn.bean.MenuTreeDto">
select * from t_test
<if test="s1==s2">
where 1=1 limit 0
</if>
<if test="${secretFilterSwitch}==1">
where 1=1 limit 0
</if>
</select>

















