How does mybatis implement multiple selections that contain all the logic? All is 0, select all and the collection contains only 0

mybatis input parameter is a list of type integer

if there is only a 0 in the list, do not Filter this property

otherwise, this field in list


the way we currently know is to judge in java that if list contains 0, send a null, to mybatis and then mybatis to determine the listings null execution attribute in (list)


in the sql xml file of mybatis configuration, use the if tag to determine whether it is equal to 0, and then use the foreach tag to achieve the in operation.

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-1b35fd1-2bfcf.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-1b35fd1-2bfcf.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?