mybatis的xml文件的完整模板




  
    
    
    
    
  
  
    
      
        
          
            
              
                
                  and ${criterion.condition}
                
                
                  and ${criterion.condition} #{criterion.value}
                
                
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                
                
                  and ${criterion.condition}
                  
                    #{listItem}
                  
                
              
            
          
        
      
    
  
  
    
      
        
          
            
              
                
                  and ${criterion.condition}
                
                
                  and ${criterion.condition} #{criterion.value}
                
                
                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
                
                
                  and ${criterion.condition}
                  
                    #{listItem}
                  
                
              
            
          
        
      
    
  
  
    id, name, phone, mail
  
  
  
  
    delete from staff
    where id = #{id,jdbcType=INTEGER}
      and name = #{name,jdbcType=VARCHAR}
  
  
    delete from staff
    
      
    
  
  
    insert into staff (id, name, phone, 
      mail)
    values (#{id,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, 
      #{mail,jdbcType=VARCHAR})
  
  
    insert into staff
    
      
        id,
      
      
        name,
      
      
        phone,
      
      
        mail,
      
    
    
      
        #{id,jdbcType=INTEGER},
      
      
        #{name,jdbcType=VARCHAR},
      
      
        #{phone,jdbcType=VARCHAR},
      
      
        #{mail,jdbcType=VARCHAR},
      
    
  
  
  
    update staff
    
      
        id = #{record.id,jdbcType=INTEGER},
      
      
        name = #{record.name,jdbcType=VARCHAR},
      
      
        phone = #{record.phone,jdbcType=VARCHAR},
      
      
        mail = #{record.mail,jdbcType=VARCHAR},
      
    
    
      
    
  
  
    update staff
    set id = #{record.id,jdbcType=INTEGER},
      name = #{record.name,jdbcType=VARCHAR},
      phone = #{record.phone,jdbcType=VARCHAR},
      mail = #{record.mail,jdbcType=VARCHAR}
    
      
    
  
  
    update staff
    
      
        phone = #{phone,jdbcType=VARCHAR},
      
      
        mail = #{mail,jdbcType=VARCHAR},
      
    
    where id = #{id,jdbcType=INTEGER}
      and name = #{name,jdbcType=VARCHAR}
  
  
    update staff
    set phone = #{phone,jdbcType=VARCHAR},
      mail = #{mail,jdbcType=VARCHAR}
    where id = #{id,jdbcType=INTEGER}
      and name = #{name,jdbcType=VARCHAR}
  

导进去就可以使用了

你可能感兴趣的:(第一次)