Mybatis 动态sql

 详情参照mybatis官方文档:https://mybatis.org/mybatis-3/zh/index.html



    
    
        
        
        
        
        
    
    
    
    
    
    
        insert into student
        
            uuid,
            
                stu_name,
            
            
                address,
            
            
                age,
            
            
                birthday,
            
            
                gender,
            
        
        
            (SELECT uuid()),
            
                #{stuName,jdbcType=VARCHAR},
            
            
                #{address,jdbcType=VARCHAR},
            
            
                #{age,jdbcType=INTEGER},
            
            
                #{birthday,jdbcType=TIMESTAMP},
            
            
                #{gender,jdbcType=VARCHAR},
            
        
    

    
        update student
        
            
                stu_name = #{stuName,jdbcType=VARCHAR},
            
            
                address = #{address,jdbcType=VARCHAR},
            
            
                age = #{age,jdbcType=INTEGER},
            
            
                birthday = #{birthday,jdbcType=TIMESTAMP},
            
            
                gender = #{gender,jdbcType=VARCHAR},
            
        
        
            uuid =#{uuid,jdbcType=VARCHAR}
        
    

 

你可能感兴趣的:(mybatis,增删改查)