MyBatis : Example 条件查询 in 用法

只是记录下。

Example example = new Example(UserxxxLog.class);
		Criteria createCriteria = example.createCriteria();
		List list = Lists.newArrayList();
		list.add(UserEvenEnum.xxx.getxxxName());
		list.add(UserEvenEnum.xxx.getxxxame());
		list.add(UserEvenEnum.xx.getxxName());
		createCriteria.andEqualTo("xxaax", xxaax);
		createCriteria.andIn("xxxType", list);

		if (!StringUtils.isEmpty(exclude.getxxxCode())) {
			createCriteria.andEqualTo("xxxCode", exclude.getxxxCode());
		}
		
		List select = userxxxLogMapper.selectByExample(example);

 

你可能感兴趣的:(框架)