MyBatis中if - else if - else 的使用
有表user(id, name, state, sex, age) 1、单个 if - else 使用。 根据状态不同进行查询 2、多个if -else if -els ...
有表user(id, name, state, sex, age) 1、单个 if - else 使用。 根据状态不同进行查询 2、多个if -else if -els ...
原因 因为 MyBatis-Plus 自带的更新方法,都有对对象空值进行判空。只有不为空的字段才会进行数据更新。 解决方式 在实体类对应的字段上加注解@TableField(strategy= ...
假设有表User(id, name, sex, age); 1、MyBatis的模糊查询 2、MyBatis在mapper.xml文件中使用大于等于,以及小于等于报错问题 m ...