General mapper query according to conditions

Example example = new Example(User.class);
Criteria criteria = example.createCriteria();
criteria.andEqualTo("name", name);
criteria.andEqualTo("userId", userId);
List<UserRegister> lists = userReigsterMapper.selectExample(example);

等于
Select * from user where name = #{name} and userId = #{id}

Guess you like

Origin blog.csdn.net/qq_36213455/article/details/103557162