mybatis-plus使用要注意的事项

使用mybatis-plus时,数据库表名只能是user而不能写成t_user

mybatis-plus的entitywapper拼接的sql解析:

User user = new User();
user.setName(name);
EntityWrapper eWrapper = new EntityWrapper(user);

if (id!=null) {
    eWrapper.where("id!={1}",id);
    }
return this.selectList(eWrapper); 

sql语句为:

SELECT  id,login_name AS loginName,`name`,`password`,salt,sex,age,phone,user_type AS userType,`status`,org_id AS orgId,ip,created,updated,last_login AS lastLogin  FROM user  
 WHERE  `name`=? 
AND (id!={1})

User user = new User();
user.setName(name);
EntityWrapper eWrapper = new EntityWrapper(user);

if (id!=null) {
    eWrapper.where("id!={0}",id);
    }
return this.selectList(eWrapper); 

sql语句为:

SELECT  id,login_name AS loginName,`name`,`password`,salt,sex,age,phone,user_type AS userType,`status`,org_id AS orgId,ip,created,updated,last_login AS lastLogin  FROM user  
 WHERE  `name`=? 
AND (id!={?})

你可能感兴趣的:(mybatis)