one of the main considerations here is the two types of parameters: arrays or collections.
And this difference mainly manifests in the Empmapper.xml file the Label collection attribute : When collection= "array", the table name parameter is an array; When collection= "list", the table name parameter is a collection.
two. Note:
Whether MyBatis is in combination with MySQL databases or with Oracle databases, the following settings and operations are also appropriate.
three. The specific examples are as follows:
Empmapper.xml:
<!--Bulk Delete employee information-->
<delete id= "batchdeleteemps" parametertype= "int" >
delete from emp where empno in< C10/><foreach item= "Empnoitem" collection= "Array" open= "(" separator= "," close= ")" >
#{empnoitem}
</foreach>
</delete>
<!--parameter description-->
<!--
emp : Table name
empno: Field Name
collection: represents type, where the argument is an array, and if it is a collection, Write list
item : is a variable name, oneself casually name
-->
Empmapper.java:
* * Bulk Delete Employee information * *
void Batchdeleteemps (int[] empno);