How mybatis example generates sql of or condition

I want to use the example class of mybatis to generate the following sql statement:

SELECT * FROM User where nick_name like "%1502%" or real_name like "%1502%" or mobile like "%1502%"

this is how I used it:

UserExample userExample = new UserExample();
UserExample.Criteria userCriteria = userExample.createCriteria();
userExample.or().andMobileLike("%1502%");
userExample.or().andRealNameLike("%1502%");
userExample.or().andNickNameLike("%1502%");
return userService.selectByExample(userExample);

but using it this way will not return the results I want. It will return all the User data without adding or restrictions
clipboard.png
asking for advice

Mar.02,2021

try this?

userExample.or().orMobileLike("%1502%");
userExample.or().orRealNameLike("%1502%");
userExample.or().orNickNameLike("%1502%");

try this:

userExample.or().andMobileLike("%1502%").andRealNameLike("%1502%").andNickNameLike("%1502%");
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9cfc2-191d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9cfc2-191d.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?