逻辑:从数据库查询多个ID的数据
//service 层
if (vmIdList.size() > 0) {
List<VirtualMachine> virtualMachineList = virtualMachineManagementDAO.getVMListAfterVMOperationByVMId(vmIdList);
}
//DAO 层
public List<VirtualMachine> getVMListAfterVMOperationByVMId(List<Integer> vmIds) {
List<VirtualMachine> virtualMachineList = this.sqlMapClientTemplate.queryForList("getVMListAfterVMOperationByVMId", vmIds);
return virtualMachineList;
}
// IBATIS 配置
<select id="getVMListAfterVMOperationByVMId"
resultClass="com.huawei.gts.nis.cloudstudio.iaas.model.VirtualMachine" parameterClass="java.util.List">
<![CDATA[
select vmid, vmorderid,accountid where vmid in
]]>
<iterate conjunction="," close=")" open="(">
#vmIds[]#
</iterate>
</select>