update if判断进行动态sql拼接

id="updateOption" parameterType="com.model.Option">
    update system_option
     set
    test="url != null and url !=''">
        url = #{url},
    

    test="description != null and description !=''">
    description = #{description},
    
    test="name != null and name !=''">
    name = #{name },
    
    test="parentID != null and parentID !=''">
        parentID = #{parentID },
    
    test="sequence != null and sequence !=''">
        sequence = #{sequence },
    
    uuid=#{uuid}
    where
    uuid = #{uuid}

你可能感兴趣的:(mybatis)