MyBatis

MyBatis,第1张

MyBatis 实现动态SQL语句: 




    
    
    
    
        select id,last_name lastName,gender,email  FROM tbl_employee
        
        
        
             id=#{id}
        

        
            AND last_name like #{lastName}
        

        
        
            AND email = #{email}
        

        
            AND gender = #{gender}
        
        
    


    
    
        
        
        SELECT id,last_name lastName,gender,email
        FROM tbl_employee
        
            
                
                    id=#{id}
                
                
                    last_name LIKE #{my_lastname}
                
                
                    email LIKE #{email}
                
                
                    gender = #{gender}
                
                
                    1=1
                
            

        

    


    
    
        UPDATE tbl_employee
        
            
                last_name = #{lastName},
            
            
                email = #{email},
            
            
                gender = #{gender},
            
        
        
            id=#{id}
        
    


    
    

    
    
        INSERT INTO tbl_employee( last_name,gender,email)
        VALUES
        
            (#{item_emps.lastName},#{item_emps.gender},#{item_emps.email})
        
    


    
    

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5693480.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存