Mapper.xml中的trim

 trim 属性
                prefix:前缀覆盖并增加其内容
                suffix:后缀覆盖并增加其内容
                prefixOverrides:前缀判断的条件
                suffixOverrides:后缀判断的条件


 
        UPDATE test 
        
         
         name = #{name},
         
         
         phone = #{phone},
         
         
         address = #{address},
         
         
        WHERE 
         id = #{id} 
 
输出sql
update test set name = #{name}, phone = #{phone}, address = #{address}   WHERE id = #{id}




输出sql 

  select * from user  WHERE user_id != #{userId}  and phone = #{phone} and state!=‘X‘  

你可能感兴趣的:(A)