select * from user where 1=1 and userName='hls' and age=19
应该是这个吧
select * from user where 1=1 and user_name='hls' and age=19
把sb.append(" and '").append(fieldName); 改成sb.append(" and '").append(columnName);
即可,老师这里可能是不小心写错了,毕竟他写的属性名和注解上的value是一样的