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.

Menu