1.參數原型xml
List<String> notFoundId = new ArrayList<String>();get
2.dao層傳參原型
public List<YdhcData> getAllOffice(List<String> notFoundId);it
3.myBatis xml讀取io
惟一值得注意的地方是:test
通常來講咱們都是經過傳參的名字去匹配參數的,可是myBatis的collection填的是參數的類型foreach
<select id="getAllOffice" resultType="YdhcData">
select so.id,so.parent_id,so.name
from sys_office so
<where>
<if test="list!=null and list.size()!=0">
so.id in (
<foreach collection="list" item="pid" index="index" separator=",">
#{pid}
</foreach>
)
</if>
</where>
</select>List