mybatis example的and or嵌套使用的问题

倘若我想查询下面的sql语句,怎么使用mybatis怎么来写

select * from 
where 
    a = 'z' 
    AND ( b = 1 OR c = 1 OR d = 1 )

select * from  table 
where (b=1 and a='z') or (c=1 and a='z') or (d=1 and a='z')