mybatis中if test中参数传递的问题:判断List属性和String属性以及set属性

在这里插入图片描述

错误写法:

在这里插入图片描述
也许眼尖的朋友会发现,我这里LIst传入的是Intger类型的,默认值是0,所以应该是test=“ids!=0”,当然了,这也是行不通的。。。

正确写法

在这里插入图片描述

测试

@Test
	public void testqueryitemlistbyid() throws Exception {
		List<Integer> list = new ArrayList<Integer>();
		list.add(1);
		list.add(3);
		List<Shopitem> items= dao.queryitemlistbyid(list);
		for (Shopitem item : items) {
			System.out.println(item);
		}
	}

在这里插入图片描述

猜你喜欢

转载自blog.csdn.net/qq_42405666/article/details/90524667