Mybatis添加功能时获取mysql自增主键和非自增主键的返回值

Mybatis获取mysql自增主键的获取
User.xml




    
        
        
            SELECT LAST_INSERT_ID()
        
        insert into user(username,birthday,sex,address) value(#{username},#{birthday},#{sex},#{address})
    


Mybatis获取mysql非自增主键的获取

User.xml


    
        
        
            SELECT uuid()
        
        insert into user(id,username,birthday,sex,address) value(#{id}.#{username},#{birthday},#{sex},#{address})
    









你可能感兴趣的:(#,MyBetis)